Class ResponseStatisticsImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.ResponseStatisticsImpl
-
- All Implemented Interfaces:
ResponseStatistics
final class ResponseStatisticsImpl extends java.lang.Object implements ResponseStatistics
Immutable response statistics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classResponseStatisticsImpl.BuilderThis builder does not need to be threadsafe since it's called only from the jersey-background-task-scheduler.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.IntegerlastResponseCodeprivate java.util.Map<java.lang.Integer,java.lang.Long>responseCodes
-
Constructor Summary
Constructors Modifier Constructor Description privateResponseStatisticsImpl(java.lang.Integer lastResponseCode, java.util.Map<java.lang.Integer,java.lang.Long> responseCodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.IntegergetLastResponseCode()Returns the response code of a last response written by the application.java.util.Map<java.lang.Integer,java.lang.Long>getResponseCodes()Returns statistics of response codes produces by the application.ResponseStatisticssnapshot()Get the immutable and consistent snapshot of the monitoring statistics.
-
-
-
Method Detail
-
getLastResponseCode
public java.lang.Integer getLastResponseCode()
Description copied from interface:ResponseStatisticsReturns the response code of a last response written by the application.- Specified by:
getLastResponseCodein interfaceResponseStatistics- Returns:
- Last response status code.
-
getResponseCodes
public java.util.Map<java.lang.Integer,java.lang.Long> getResponseCodes()
Description copied from interface:ResponseStatisticsReturns 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:
getResponseCodesin interfaceResponseStatistics- Returns:
- Map with status codes keys and count as values.
-
snapshot
public ResponseStatistics snapshot()
Description copied from interface:ResponseStatisticsGet 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 interfaceResponseStatistics- Returns:
- Snapshot of response statistics.
-
-