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 classBuilder of resource statistics instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExecutionStatisticsprivate final ExecutionStatisticsprivate final Map<ResourceMethod, ResourceMethodStatistics> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateResourceStatisticsImpl(Map<ResourceMethod, ResourceMethodStatistics> resourceMethods, ExecutionStatistics resourceExecutionStatistics, ExecutionStatistics requestExecutionStatistics) -
Method Summary
Modifier and TypeMethodDescriptionGetexecution statisticsthat 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 statisticsthat 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:ResourceStatisticsGetexecution statisticsthat 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:
getResourceMethodExecutionStatisticsin interfaceResourceStatistics- Returns:
- Execution statistics of all resource method in this resource.
-
getRequestExecutionStatistics
Description copied from interface:ResourceStatisticsGetexecution statisticsthat 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:
getRequestExecutionStatisticsin interfaceResourceStatistics- Returns:
- Execution statistics of entire request processing for all resource method from this resource.
-
getResourceMethodStatistics
Description copied from interface:ResourceStatisticsReturn the statistics for resource method. Keys of returned map areresource methodsavailable in the resource and values are execution statistics of these resource methods.- Specified by:
getResourceMethodStatisticsin interfaceResourceStatistics- Returns:
- Map with
resource methodkeys and correspondingresource method statistics.
-
snapshot
Description copied from interface:ResourceStatisticsGet 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:
snapshotin interfaceResourceStatistics- Returns:
- Snapshot of resource statistics.
-