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 classResourceMethodStatisticsImpl.BuilderBuilder of resource method statistics.(package private) static classResourceMethodStatisticsImpl.FactoryFactory for creating and storing resource method statistics.
-
Field Summary
Fields Modifier and Type Field Description private ExecutionStatisticsrequestExecutionStatisticsprivate ResourceMethodresourceMethodprivate ExecutionStatisticsresourceMethodExecutionStatistics
-
Constructor Summary
Constructors Modifier Constructor Description privateResourceMethodStatisticsImpl(ResourceMethod resourceMethod, ExecutionStatistics resourceMethodExecutionStatistics, ExecutionStatistics requestExecutionStatistics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionStatisticsgetMethodStatistics()Getexecution statisticsthat contain measurements of times only for execution of resource method.ExecutionStatisticsgetRequestStatistics()Getexecution 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.ResourceMethodgetResourceMethod()Get aresource methodfor which thisResourceMethodStatisticsare calculated.ResourceMethodStatisticssnapshot()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:ResourceMethodStatisticsGetexecution 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 method defined byResourceMethodStatistics.getResourceMethod().- Specified by:
getRequestStatisticsin interfaceResourceMethodStatistics- Returns:
- Execution statistics of entire request processing for one resource method.
-
getMethodStatistics
public ExecutionStatistics getMethodStatistics()
Description copied from interface:ResourceMethodStatisticsGetexecution statisticsthat 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:
getMethodStatisticsin interfaceResourceMethodStatistics- Returns:
- Execution statistics of one resource method.
-
getResourceMethod
public ResourceMethod getResourceMethod()
Description copied from interface:ResourceMethodStatisticsGet aresource methodfor which thisResourceMethodStatisticsare calculated.- Specified by:
getResourceMethodin interfaceResourceMethodStatistics- Returns:
- Resource method.
-
snapshot
public ResourceMethodStatistics snapshot()
Description copied from interface:ResourceMethodStatisticsGet 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 interfaceResourceMethodStatistics- Returns:
- Snapshot of resource method statistics.
-
-