Class ExecutionStatisticsImpl
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.ExecutionStatisticsImpl
-
- All Implemented Interfaces:
ExecutionStatistics
final class ExecutionStatisticsImpl extends java.lang.Object implements ExecutionStatistics
Immutable Execution statistics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classExecutionStatisticsImpl.BuilderBuilder of execution statistics.
-
Field Summary
Fields Modifier and Type Field Description (package private) static ExecutionStatisticsEMPTYEmpty execution statistics instance.private longlastStartTimeprivate java.util.Map<java.lang.Long,TimeWindowStatistics>timeWindowStatistics
-
Constructor Summary
Constructors Modifier Constructor Description privateExecutionStatisticsImpl(long lastStartTime, java.util.Map<java.lang.Long,TimeWindowStatistics> timeWindowStatistics)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.DategetLastStartTime()Return time when target was executed last time.java.util.Map<java.lang.Long,TimeWindowStatistics>getTimeWindowStatistics()Returns time window statistics for available time window sizes.ExecutionStatisticssnapshot()Get the immutable consistent snapshot of the monitoring statistics.
-
-
-
Field Detail
-
EMPTY
static final ExecutionStatistics EMPTY
Empty execution statistics instance.
-
lastStartTime
private final long lastStartTime
-
timeWindowStatistics
private final java.util.Map<java.lang.Long,TimeWindowStatistics> timeWindowStatistics
-
-
Constructor Detail
-
ExecutionStatisticsImpl
private ExecutionStatisticsImpl(long lastStartTime, java.util.Map<java.lang.Long,TimeWindowStatistics> timeWindowStatistics)
-
-
Method Detail
-
getLastStartTime
public java.util.Date getLastStartTime()
Description copied from interface:ExecutionStatisticsReturn time when target was executed last time. The time is measured before the target was executed.- Specified by:
getLastStartTimein interfaceExecutionStatistics- Returns:
- Time of last execution.
-
getTimeWindowStatistics
public java.util.Map<java.lang.Long,TimeWindowStatistics> getTimeWindowStatistics()
Description copied from interface:ExecutionStatisticsReturns time window statistics for available time window sizes. The returned map contains sizes of a time window in milliseconds as keys andtime window statisticsfor the corresponding time window as value.- Specified by:
getTimeWindowStatisticsin interfaceExecutionStatistics- Returns:
- Map with size of a time window in milliseconds as keys and
time window statisticsfor the corresponding time window as value.
-
snapshot
public ExecutionStatistics snapshot()
Description copied from interface:ExecutionStatisticsGet the immutable 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 interfaceExecutionStatistics- Returns:
- Snapshot of execution statistics.
-
-