Class ExecutionStatisticsImpl
java.lang.Object
org.glassfish.jersey.server.internal.monitoring.ExecutionStatisticsImpl
- All Implemented Interfaces:
ExecutionStatistics
Immutable Execution statistics.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
Builder of execution statistics. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ExecutionStatistics
Empty execution statistics instance.private final long
private final Map
<Long, TimeWindowStatistics> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ExecutionStatisticsImpl
(long lastStartTime, Map<Long, TimeWindowStatistics> timeWindowStatistics) -
Method Summary
Modifier and TypeMethodDescriptionReturn time when target was executed last time.Returns time window statistics for available time window sizes.snapshot()
Get the immutable consistent snapshot of the monitoring statistics.
-
Field Details
-
EMPTY
Empty execution statistics instance. -
lastStartTime
private final long lastStartTime -
timeWindowStatistics
-
-
Constructor Details
-
ExecutionStatisticsImpl
private ExecutionStatisticsImpl(long lastStartTime, Map<Long, TimeWindowStatistics> timeWindowStatistics)
-
-
Method Details
-
getLastStartTime
Description copied from interface:ExecutionStatistics
Return time when target was executed last time. The time is measured before the target was executed.- Specified by:
getLastStartTime
in interfaceExecutionStatistics
- Returns:
- Time of last execution.
-
getTimeWindowStatistics
Description copied from interface:ExecutionStatistics
Returns time window statistics for available time window sizes. The returned map contains sizes of a time window in milliseconds as keys andtime window statistics
for the corresponding time window as value.- Specified by:
getTimeWindowStatistics
in interfaceExecutionStatistics
- Returns:
- Map with size of a time window in milliseconds as keys and
time window statistics
for the corresponding time window as value.
-
snapshot
Description copied from interface:ExecutionStatistics
Get 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:
snapshot
in interfaceExecutionStatistics
- Returns:
- Snapshot of execution statistics.
-