Package com.dynatrace.openkit.api
Interface WebRequestTracer
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
NullWebRequestTracer,WebRequestTracerBaseImpl,WebRequestTracerStringURL,WebRequestTracerURLConnection
public interface WebRequestTracer extends java.io.CloseableThis interface allows tracing and timing of a web request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetTag()Returns the Dynatrace tag which has to be set manually as Dynatrace HTTP header (OpenKitConstants.WEBREQUEST_TAG_HEADER).WebRequestTracersetBytesReceived(int bytesReceived)Sets the amount of received data of this web request.WebRequestTracersetBytesSent(int bytesSent)Sets the amount of sent data of this web request.WebRequestTracerstart()Starts the web request timing.voidstop(int responseCode)Stops the web request timing with the given response code.
-
-
-
Method Detail
-
getTag
java.lang.String getTag()
Returns the Dynatrace tag which has to be set manually as Dynatrace HTTP header (OpenKitConstants.WEBREQUEST_TAG_HEADER).
This is only necessary for tracing web requests via 3rd party HTTP clients.- Returns:
- the Dynatrace tag to be set as HTTP header value or an empty String if capture is off
-
setBytesSent
WebRequestTracer setBytesSent(int bytesSent)
Sets the amount of sent data of this web request. Has to be called beforestop(int).- Parameters:
bytesSent- number of bytes
-
setBytesReceived
WebRequestTracer setBytesReceived(int bytesReceived)
Sets the amount of received data of this web request. Has to be called beforestop(int).- Parameters:
bytesReceived- number of bytes
-
start
WebRequestTracer start()
Starts the web request timing. Should be called when the web request is initiated.
-
stop
void stop(int responseCode)
Stops the web request timing with the given response code. Should be called when the web request is finished.- Parameters:
responseCode- response code of this web request
-
-