All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.newrelic.agent.transport.DataSender Maven / Gradle / Ivy

The newest version!
/*
 *
 *  * Copyright 2020 New Relic Corporation. All rights reserved.
 *  * SPDX-License-Identifier: Apache-2.0
 *
 */

package com.newrelic.agent.transport;

import com.newrelic.agent.MetricData;
import com.newrelic.agent.errors.TracedError;
import com.newrelic.agent.model.AnalyticsEvent;
import com.newrelic.agent.model.CustomInsightsEvent;
import com.newrelic.agent.model.ErrorEvent;
import com.newrelic.agent.model.LogEvent;
import com.newrelic.agent.model.SpanEvent;
import com.newrelic.agent.profile.ProfileData;
import com.newrelic.agent.sql.SqlTrace;
import com.newrelic.agent.trace.TransactionTrace;
import org.json.simple.JSONStreamAware;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface DataSender {

    Map connect(Map startupOptions) throws Exception;

    List> getAgentCommands() throws Exception;

    void sendCommandResults(Map commandResults) throws Exception;

    void sendErrorData(List errors) throws Exception;

    void sendErrorEvents(int reservoirSize, int eventsSeen, Collection errorEvents) throws Exception;

    /**
     * Send non-aggregated events for analytics
     */
     void sendAnalyticsEvents(int reservoirSize, int eventsSeen, Collection events) throws Exception;

    /**
     * Send non-aggregated custom events for analytics
     */
    void sendCustomAnalyticsEvents(int reservoirSize, int eventsSeen, Collection events) throws Exception;

    /**
     * Send non-aggregated Log events
     */
    void sendLogEvents(Collection events) throws Exception;

    /**
     * Send non-aggregated span events
     */
    void sendSpanEvents(int reservoirSize, int eventsSeen, Collection events) throws Exception;

    /**
     * Send metric data to New Relic.
     *
     * @param beginTimeMillis the last time metric data was sent to New Relic
     * @param endTimeMillis the time now
     * @param metricData the metric data to send
     * @throws Exception if there is a problem sending the metric data
     */
    void sendMetricData(long beginTimeMillis, long endTimeMillis, List metricData) throws Exception;

    /**
     * Send thread profiles to New Relic.
     *
     * @param profiles the profiles to send
     * @return a list of profile IDs for the profiles
     * @throws Exception if there is a problem sending the profiles
     */
    List sendProfileData(List profiles) throws Exception;

    void sendSqlTraceData(List sqlTraces) throws Exception;

    void sendTransactionTraceData(List traces) throws Exception;

    void sendModules(List jarDataToSend) throws Exception;

    void shutdown(long timeMillis) throws Exception;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy