Interface ResourceMethodStatistics
-
public interface ResourceMethodStatistics
Monitoring statistics an of an execution of the resource method. Thesnapshot()
method returns an immutable snapshot with consistent data. The principles of using statistics is similar to principles of usingMonitoringStatistics
. Statistics contain twoExecutionStatistics
wheregetMethodStatistics()
contains statistics for execution of the code of resource method andgetRequestStatistics()
contains statistics for complete processing of requests that were matched to the resource method. This implies thatgetRequestStatistics()
will tend to contain higher time measurements as they measure total request processing time and not only execution of the resource method. 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 methodsnapshot()
should be used.- Author:
- Miroslav Fuksa
- See Also:
See monitoring statistics for more details.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ExecutionStatistics
getMethodStatistics()
Getexecution statistics
that contain measurements of times only for execution of resource method.ExecutionStatistics
getRequestStatistics()
Getexecution 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.ResourceMethod
getResourceMethod()
Get aresource method
for which thisResourceMethodStatistics
are calculated.ResourceMethodStatistics
snapshot()
Deprecated.implementing class is immutable hence snapshot creation is not needed anymore
-
-
-
Method Detail
-
getMethodStatistics
ExecutionStatistics getMethodStatistics()
Getexecution statistics
that contain measurements of times only for execution of resource method. Durations average time, minimum time and maximum time measure only time of execution of resource method code. It does not involve other request processing phases.- Returns:
- Execution statistics of one resource method.
-
getRequestStatistics
ExecutionStatistics getRequestStatistics()
Getexecution 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 method defined bygetResourceMethod()
.- Returns:
- Execution statistics of entire request processing for one resource method.
-
getResourceMethod
ResourceMethod getResourceMethod()
Get aresource method
for which thisResourceMethodStatistics
are calculated.- Returns:
- Resource method.
-
snapshot
@Deprecated ResourceMethodStatistics snapshot()
Deprecated.implementing class is immutable hence snapshot creation is not needed anymoreGet 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 method statistics.
-
-