Class AbstractTimeSnapshot
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.core.AbstractTimeSnapshot
-
- All Implemented Interfaces:
UniformTimeSnapshot
- Direct Known Subclasses:
UniformTimeSimpleSnapshot
,UniformTimeValuesSnapshot
public abstract class AbstractTimeSnapshot extends java.lang.Object implements UniformTimeSnapshot
Base implementation ofUniformTimeSnapshot
.
-
-
Field Summary
Fields Modifier and Type Field Description private long
timeInterval
private java.util.concurrent.TimeUnit
timeIntervalUnit
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTimeSnapshot(long timeInterval, java.util.concurrent.TimeUnit timeIntervalUnit)
Constructor to be used by subclasses overriding the base abstract uniform time snapshot class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getRate(java.util.concurrent.TimeUnit timeUnit)
The rate of values in this snapshot for one given time unit.long
getTimeInterval(java.util.concurrent.TimeUnit timeUnit)
The time interval for which this snapshot was created.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.glassfish.jersey.server.internal.monitoring.core.UniformTimeSnapshot
getMax, getMean, getMin, size
-
-
-
-
Constructor Detail
-
AbstractTimeSnapshot
protected AbstractTimeSnapshot(long timeInterval, java.util.concurrent.TimeUnit timeIntervalUnit)
Constructor to be used by subclasses overriding the base abstract uniform time snapshot class.- Parameters:
timeInterval
- The time interval of this snapshot.timeIntervalUnit
- The time interval unit.
-
-
Method Detail
-
getTimeInterval
public long getTimeInterval(java.util.concurrent.TimeUnit timeUnit)
Description copied from interface:UniformTimeSnapshot
The time interval for which this snapshot was created.- Specified by:
getTimeInterval
in interfaceUniformTimeSnapshot
- Parameters:
timeUnit
- The time unit in which to return the time interval.- Returns:
- The time interval the snapshot was created at for the given time unit.
-
getRate
public double getRate(java.util.concurrent.TimeUnit timeUnit)
Description copied from interface:UniformTimeSnapshot
The rate of values in this snapshot for one given time unit.- Specified by:
getRate
in interfaceUniformTimeSnapshot
- Parameters:
timeUnit
- The time unit at which to get the rate- Returns:
- The rate
-
-