Package alluxio.metrics
Class MaxReservoir
- java.lang.Object
-
- alluxio.metrics.MaxReservoir
-
- All Implemented Interfaces:
com.codahale.metrics.Reservoir
public class MaxReservoir extends java.lang.Object implements com.codahale.metrics.Reservoir
A wrapper aroundReservoir
that keeps track of the max value sent as an update to this reservoir. Any snapshot returned by the reservoir will return this max value.
-
-
Constructor Summary
Constructors Constructor Description MaxReservoir(com.codahale.metrics.Reservoir delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.codahale.metrics.Snapshot
getSnapshot()
Returns a snapshot of the reservoir's values, which has the max value set as the overall max value sent as an update to this reservoir.int
size()
Returns the number of values recorded.void
update(long value)
Adds a new recorded value to the reservoir.
-
-
-
Method Detail
-
size
public int size()
Returns the number of values recorded.- Specified by:
size
in interfacecom.codahale.metrics.Reservoir
- Returns:
- the number of values recorded
-
update
public void update(long value)
Adds a new recorded value to the reservoir.- Specified by:
update
in interfacecom.codahale.metrics.Reservoir
- Parameters:
value
- a new recorded value
-
getSnapshot
public com.codahale.metrics.Snapshot getSnapshot()
Returns a snapshot of the reservoir's values, which has the max value set as the overall max value sent as an update to this reservoir.- Specified by:
getSnapshot
in interfacecom.codahale.metrics.Reservoir
- Returns:
- a snapshot of the reservoir's values
-
-