Class ResourceMethodStatisticsImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.ResourceMethodStatisticsImpl
-
- All Implemented Interfaces:
ResourceMethodStatistics
final class ResourceMethodStatisticsImpl extends java.lang.Object implements ResourceMethodStatistics
Immutable resource method statistics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ResourceMethodStatisticsImpl.Builder
Builder of resource method statistics.(package private) static class
ResourceMethodStatisticsImpl.Factory
Factory for creating and storing resource method statistics.
-
Field Summary
Fields Modifier and Type Field Description private ExecutionStatistics
requestExecutionStatistics
private ResourceMethod
resourceMethod
private ExecutionStatistics
resourceMethodExecutionStatistics
-
Constructor Summary
Constructors Modifier Constructor Description private
ResourceMethodStatisticsImpl(ResourceMethod resourceMethod, ExecutionStatistics resourceMethodExecutionStatistics, ExecutionStatistics requestExecutionStatistics)
-
Method Summary
All Methods Instance Methods Concrete 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()
Get the immutable and consistent snapshot of the monitoring statistics.
-
-
-
Field Detail
-
resourceMethodExecutionStatistics
private final ExecutionStatistics resourceMethodExecutionStatistics
-
requestExecutionStatistics
private final ExecutionStatistics requestExecutionStatistics
-
resourceMethod
private final ResourceMethod resourceMethod
-
-
Constructor Detail
-
ResourceMethodStatisticsImpl
private ResourceMethodStatisticsImpl(ResourceMethod resourceMethod, ExecutionStatistics resourceMethodExecutionStatistics, ExecutionStatistics requestExecutionStatistics)
-
-
Method Detail
-
getRequestStatistics
public ExecutionStatistics getRequestStatistics()
Description copied from interface:ResourceMethodStatistics
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 byResourceMethodStatistics.getResourceMethod()
.- Specified by:
getRequestStatistics
in interfaceResourceMethodStatistics
- Returns:
- Execution statistics of entire request processing for one resource method.
-
getMethodStatistics
public ExecutionStatistics getMethodStatistics()
Description copied from interface:ResourceMethodStatistics
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.- Specified by:
getMethodStatistics
in interfaceResourceMethodStatistics
- Returns:
- Execution statistics of one resource method.
-
getResourceMethod
public ResourceMethod getResourceMethod()
Description copied from interface:ResourceMethodStatistics
Get aresource method
for which thisResourceMethodStatistics
are calculated.- Specified by:
getResourceMethod
in interfaceResourceMethodStatistics
- Returns:
- Resource method.
-
snapshot
public ResourceMethodStatistics snapshot()
Description copied from interface:ResourceMethodStatistics
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 interfaceResourceMethodStatistics
- Returns:
- Snapshot of resource method statistics.
-
-