Interface ResourceStatistics


public interface ResourceStatistics
Monitoring statistics of the resource. The resource is a set of resource methods with specific characteristics that is not defined by this interface. The resource can be set of resource methods that are accessible on the same URI (in the case of MonitoringStatistics.getUriStatistics()) or the set of resource methods defined in one Class (in case of MonitoringStatistics.getResourceClassStatistics()).

Statistics retrieved from Jersey runtime might be mutable and thanks to it might provide inconsistent data as not all statistics are updated in the same time. To retrieve the immutable and consistent statistics data the method snapshot() should be used.

The principles of using statistics is similar to principles of using MonitoringStatistics.

Author:
Miroslav Fuksa
See Also:
  • Method Details

    • getResourceMethodExecutionStatistics

      ExecutionStatistics getResourceMethodExecutionStatistics()
      Get execution statistics that contain measurements of times only for execution of resource methods. Durations average time, minimum time and maximum time measure only time of execution of resource methods code. It does not involve other request processing phases.
      Returns:
      Execution statistics of all resource method in this resource.
    • getRequestExecutionStatistics

      ExecutionStatistics getRequestExecutionStatistics()
      Get execution statistics that contain measurements of times for whole processing from time when request comes into the Jersey application until the response is written to the underlying IO container. The statistics involves only requests that were matched to resource methods defined in getResourceMethodStatistics().
      Returns:
      Execution statistics of entire request processing for all resource method from this resource.
    • getResourceMethodStatistics

      Map<ResourceMethod,ResourceMethodStatistics> getResourceMethodStatistics()
      Return the statistics for resource method. Keys of returned map are resource methods available in the resource and values are execution statistics of these resource methods.
      Returns:
      Map with resource method keys and corresponding resource method statistics.
    • snapshot

      Deprecated.
      implementing class is immutable hence snapshot creation is not needed anymore
      Get the immutable and consistent snapshot of the monitoring statistics. Working with snapshots might have negative performance impact as snapshot must be created but ensures consistency of data over time. However, the usage of snapshot is encouraged to avoid working with inconsistent data. Not all statistics must be updated in the same time on mutable version of statistics.
      Returns:
      Snapshot of resource statistics.