final class TimeWindowStatisticsImpl extends java.lang.Object implements TimeWindowStatistics
Time window statistics
that uses backing SlidingWindowTimeReservoir
for its
Builder
implementation.Modifier and Type | Class and Description |
---|---|
(package private) static class |
TimeWindowStatisticsImpl.Builder<V>
Builder of time window statistics.
|
Modifier and Type | Field and Description |
---|---|
private long |
averageDuration |
private static java.util.concurrent.ConcurrentHashMap<java.lang.Long,TimeWindowStatisticsImpl> |
EMPTY |
private long |
interval |
private long |
maximumDuration |
private long |
minimumDuration |
private double |
requestsPerSecond |
private long |
totalCount |
Modifier | Constructor and Description |
---|---|
private |
TimeWindowStatisticsImpl(long interval,
double requestsPerSecond,
long minimumDuration,
long maximumDuration,
long averageDuration,
long totalCount) |
private |
TimeWindowStatisticsImpl(long interval,
UniformTimeSnapshot snapshot) |
Modifier and Type | Method and Description |
---|---|
long |
getAverageDuration()
Returns the average duration (processing time) in milliseconds of the request processing measured
in the time window.
|
long |
getMaximumDuration()
Returns the maximum duration (processing time) in milliseconds of the request processing measured
in the time window.
|
long |
getMinimumDuration()
Returns the minimum duration (processing time) in milliseconds of the request processing measured
in the time window.
|
long |
getRequestCount()
Returns the count of requests received measured in the time window.
|
double |
getRequestsPerSecond()
Returns average value of how many requests per second were received by application in the time window.
|
long |
getTimeWindow()
Returns the size of time window in milliseconds.
|
TimeWindowStatistics |
snapshot()
Get the immutable and consistent snapshot of the monitoring statistics.
|
private static final java.util.concurrent.ConcurrentHashMap<java.lang.Long,TimeWindowStatisticsImpl> EMPTY
private final long interval
private final long minimumDuration
private final long maximumDuration
private final long averageDuration
private final long totalCount
private final double requestsPerSecond
private TimeWindowStatisticsImpl(long interval, double requestsPerSecond, long minimumDuration, long maximumDuration, long averageDuration, long totalCount)
private TimeWindowStatisticsImpl(long interval, UniformTimeSnapshot snapshot)
public long getTimeWindow()
TimeWindowStatistics
getTimeWindow
in interface TimeWindowStatistics
public double getRequestsPerSecond()
TimeWindowStatistics
getRequestsPerSecond
in interface TimeWindowStatistics
public long getMinimumDuration()
TimeWindowStatistics
getMinimumDuration
in interface TimeWindowStatistics
public long getMaximumDuration()
TimeWindowStatistics
getMaximumDuration
in interface TimeWindowStatistics
public long getRequestCount()
TimeWindowStatistics
getRequestCount
in interface TimeWindowStatistics
public TimeWindowStatistics snapshot()
TimeWindowStatistics
snapshot
in interface TimeWindowStatistics
public long getAverageDuration()
TimeWindowStatistics
getAverageDuration
in interface TimeWindowStatistics