Class ResponseStatisticsImpl
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.ResponseStatisticsImpl
- All Implemented Interfaces:
ResponseStatistics
Immutable response statistics.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
This builder does not need to be threadsafe since it's called only from the jersey-background-task-scheduler. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ResponseStatisticsImpl
(Integer lastResponseCode, Map<Integer, Long> responseCodes) -
Method Summary
Modifier and TypeMethodDescriptionReturns the response code of a last response written by the application.Returns statistics of response codes produces by the application.snapshot()
Get the immutable and consistent snapshot of the monitoring statistics.
-
Field Details
-
responseCodes
-
lastResponseCode
-
-
Constructor Details
-
ResponseStatisticsImpl
-
-
Method Details
-
getLastResponseCode
Description copied from interface:ResponseStatistics
Returns the response code of a last response written by the application.- Specified by:
getLastResponseCode
in interfaceResponseStatistics
- Returns:
- Last response status code.
-
getResponseCodes
Description copied from interface:ResponseStatistics
Returns statistics of response codes produces by the application. Keys of a returned map are response status codes and values is the the count of responses with these status count. Values are measured since start of the application.- Specified by:
getResponseCodes
in interfaceResponseStatistics
- Returns:
- Map with status codes keys and count as values.
-
snapshot
Description copied from interface:ResponseStatistics
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 interfaceResponseStatistics
- Returns:
- Snapshot of response statistics.
-