Package co.elastic.apm.agent.report
Class AbstractIntakeApiHandler
- java.lang.Object
-
- co.elastic.apm.agent.report.AbstractIntakeApiHandler
-
- Direct Known Subclasses:
IntakeV2ReportingEventHandler
public class AbstractIntakeApiHandler extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ApmServerClientapmServerClientprotected java.net.HttpURLConnectionconnectionprotected longcurrentlyTransmittingprotected java.util.zip.Deflaterdeflaterprotected longdroppedprotected interrorCountprotected static intGZIP_COMPRESSION_LEVELprotected org.slf4j.Loggerloggerprotected java.io.OutputStreamosprotected PayloadSerializerpayloadSerializerprotected longreportedprotected ReporterConfigurationreporterConfigurationprotected booleanshutDown
-
Constructor Summary
Constructors Constructor Description AbstractIntakeApiHandler(ReporterConfiguration reporterConfiguration, PayloadSerializer payloadSerializer, ApmServerClient apmServerClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidendRequest()longgetDropped()intgetErrorCount()longgetReported()protected voidonConnectionError(java.lang.Integer responseCode, long droppedEvents, long reportedEvents)protected voidonRequestError(java.lang.Integer responseCode, java.io.InputStream inputStream, java.io.IOException e)protected voidonRequestSuccess()protected booleanshouldEndRequest()protected java.net.HttpURLConnectionstartRequest(java.lang.String endpoint)
-
-
-
Field Detail
-
logger
protected final org.slf4j.Logger logger
-
GZIP_COMPRESSION_LEVEL
protected static final int GZIP_COMPRESSION_LEVEL
- See Also:
- Constant Field Values
-
reporterConfiguration
protected final ReporterConfiguration reporterConfiguration
-
payloadSerializer
protected final PayloadSerializer payloadSerializer
-
apmServerClient
protected final ApmServerClient apmServerClient
-
deflater
protected java.util.zip.Deflater deflater
-
currentlyTransmitting
protected long currentlyTransmitting
-
reported
protected long reported
-
dropped
protected long dropped
-
connection
@Nullable protected java.net.HttpURLConnection connection
-
os
@Nullable protected java.io.OutputStream os
-
errorCount
protected int errorCount
-
shutDown
protected volatile boolean shutDown
-
-
Constructor Detail
-
AbstractIntakeApiHandler
public AbstractIntakeApiHandler(ReporterConfiguration reporterConfiguration, PayloadSerializer payloadSerializer, ApmServerClient apmServerClient)
-
-
Method Detail
-
shouldEndRequest
protected boolean shouldEndRequest()
-
startRequest
@Nullable protected java.net.HttpURLConnection startRequest(java.lang.String endpoint) throws java.lang.Exception- Throws:
java.lang.Exception
-
endRequest
public void endRequest()
-
onRequestError
protected void onRequestError(java.lang.Integer responseCode, java.io.InputStream inputStream, @Nullable java.io.IOException e)
-
onConnectionError
protected void onConnectionError(@Nullable java.lang.Integer responseCode, long droppedEvents, long reportedEvents)
-
getReported
public long getReported()
-
getDropped
public long getDropped()
-
getErrorCount
public int getErrorCount()
-
close
public void close()
-
onRequestSuccess
protected void onRequestSuccess()
-
-