Package 

Class RumNetworkInstrumentation


  • 
    public final class RumNetworkInstrumentation
    
                        

    For internal usage only.

    Handles RUM (Real User Monitoring) instrumentation for network resources. This class provides methods to track HTTP requests and responses as RUM resources.

    This class operates as a middle layer between any specific library instrumentation and SDK core components, making it possible to share the same logic between different networking libraries (OkHttp, Cronet, etc.).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final SdkCore sdkCore
    • Method Summary

      Modifier and Type Method Description
      final SdkCore getSdkCore()
      final Unit sendWaitForResourceTimingEvent(HttpRequestInfo requestInfo) Sends an event to indicate that resource timing information is expected for this request.
      final Unit sendTiming(HttpRequestInfo requestInfo, ResourceTiming resourceTiming) Sends resource timing information for a request.
      final Unit startResource(HttpRequestInfo requestInfo) Starts tracking a network resource.
      final Unit stopResource(HttpRequestInfo requestInfo, HttpResponseInfo responseInfo, Map<String, Object> attributes) Stops tracking a network resource with a successful response.
      final Unit stopResourceWithError(HttpRequestInfo requestInfo, Throwable throwable) Stops tracking a network resource with an error.
      final Unit reportInstrumentationError(Function0<String> message) Reports an instrumentation error to the internal logger.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • sendWaitForResourceTimingEvent

         final Unit sendWaitForResourceTimingEvent(HttpRequestInfo requestInfo)

        Sends an event to indicate that resource timing information is expected for this request.

        Parameters:
        requestInfo - the request information
      • sendTiming

         final Unit sendTiming(HttpRequestInfo requestInfo, ResourceTiming resourceTiming)

        Sends resource timing information for a request.

        Parameters:
        requestInfo - the request information
        resourceTiming - the timing information to report
      • startResource

         final Unit startResource(HttpRequestInfo requestInfo)

        Starts tracking a network resource.

        Parameters:
        requestInfo - the request information
      • stopResource

        @WorkerThread() final Unit stopResource(HttpRequestInfo requestInfo, HttpResponseInfo responseInfo, Map<String, Object> attributes)

        Stops tracking a network resource with a successful response.

        Parameters:
        requestInfo - the request information
        responseInfo - the response information
        attributes - additional attributes to attach to the resource event
      • stopResourceWithError

         final Unit stopResourceWithError(HttpRequestInfo requestInfo, Throwable throwable)

        Stops tracking a network resource with an error.

        Parameters:
        requestInfo - the request information
        throwable - the error that occurred
      • reportInstrumentationError

         final Unit reportInstrumentationError(Function0<String> message)

        Reports an instrumentation error to the internal logger.

        Parameters:
        message - the error message to report