Class MonitoringStatisticsImpl.Builder

java.lang.Object
org.glassfish.jersey.server.internal.monitoring.MonitoringStatisticsImpl.Builder
Enclosing class:
MonitoringStatisticsImpl

static class MonitoringStatisticsImpl.Builder extends Object
Builder of monitoring statistics.

This builder does not need to be threadsafe as it's only accessed by jersey-background-task-scheduler. However, BUILDING_FUNCTION is triggered when it is accessed (e.g., by servlet-container thread-pool threads) which adds threadsafe constraint on some of the sub-builders.

Sub-Builders that require thread-safety


 The rest does not need to be thread-safe
 
  • Field Details

  • Constructor Details

    • Builder

      Builder()
      Create a new builder.
    • Builder

      Builder(ResourceModel resourceModel)
      Create a new builder and initialize it from resource model.
      Parameters:
      resourceModel - resource model.
  • Method Details

    • processResource

      private void processResource(Resource resource, String pathPrefix)
    • getOrCreateResourceBuilder

      private ResourceStatisticsImpl.Builder getOrCreateResourceBuilder(ResourceMethod resourceMethod)
    • getExceptionMapperStatisticsBuilder

      ExceptionMapperStatisticsImpl.Builder getExceptionMapperStatisticsBuilder()
      Get the exception mapper statistics builder.
      Returns:
      Builder of internal exception mapper statistics.
    • addRequestExecution

      void addRequestExecution(long startTime, long duration)
      Add global request execution.
      Parameters:
      startTime - time of the execution.
      duration - duration of the execution.
    • addExecution

      void addExecution(String uri, ResourceMethod resourceMethod, long methodTime, long methodDuration, long requestTime, long requestDuration)
      Add execution of a resource method.
      Parameters:
      uri - String uri which was executed.
      resourceMethod - Resource method.
      methodTime - Time spent on execution of resource method itself (Unix timestamp format).
      methodDuration - Time of execution of the resource method.
      requestTime - Time of whole request processing (from receiving the request until writing the response). (Unix timestamp format)
      requestDuration - Time when the request matching to the executed resource method has been received by Jersey.
    • addResponseCode

      void addResponseCode(int responseCode)
      Add a response status code produces by Jersey.
      Parameters:
      responseCode - Response status code.
    • build

      Build a new instance of monitoring statistics.
      Returns:
      New instance of MonitoringStatisticsImpl.