Class ResourceStatisticsImpl
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.ResourceStatisticsImpl
- All Implemented Interfaces:
ResourceStatistics
Immutable resource statistics implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Builder of resource statistics instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExecutionStatistics
private final ExecutionStatistics
private final Map
<ResourceMethod, ResourceMethodStatistics> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ResourceStatisticsImpl
(Map<ResourceMethod, ResourceMethodStatistics> resourceMethods, ExecutionStatistics resourceExecutionStatistics, ExecutionStatistics requestExecutionStatistics) -
Method Summary
Modifier and TypeMethodDescriptionGetexecution 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.Getexecution statistics
that contain measurements of times only for execution of resource methods.Return the statistics for resource method.snapshot()
Get the immutable and consistent snapshot of the monitoring statistics.
-
Field Details
-
resourceMethods
-
resourceExecutionStatistics
-
requestExecutionStatistics
-
-
Constructor Details
-
ResourceStatisticsImpl
private ResourceStatisticsImpl(Map<ResourceMethod, ResourceMethodStatistics> resourceMethods, ExecutionStatistics resourceExecutionStatistics, ExecutionStatistics requestExecutionStatistics)
-
-
Method Details
-
getResourceMethodExecutionStatistics
Description copied from interface:ResourceStatistics
Getexecution 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.- Specified by:
getResourceMethodExecutionStatistics
in interfaceResourceStatistics
- Returns:
- Execution statistics of all resource method in this resource.
-
getRequestExecutionStatistics
Description copied from interface:ResourceStatistics
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 methods defined inResourceStatistics.getResourceMethodStatistics()
.- Specified by:
getRequestExecutionStatistics
in interfaceResourceStatistics
- Returns:
- Execution statistics of entire request processing for all resource method from this resource.
-
getResourceMethodStatistics
Description copied from interface:ResourceStatistics
Return the statistics for resource method. Keys of returned map areresource methods
available in the resource and values are execution statistics of these resource methods.- Specified by:
getResourceMethodStatistics
in interfaceResourceStatistics
- Returns:
- Map with
resource method
keys and correspondingresource method statistics
.
-
snapshot
Description copied from interface:ResourceStatistics
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.- Specified by:
snapshot
in interfaceResourceStatistics
- Returns:
- Snapshot of resource statistics.
-