Package io.engineblock.metrics
Class DeltaHdrHistogramReservoir
- java.lang.Object
-
- io.engineblock.metrics.DeltaHdrHistogramReservoir
-
- All Implemented Interfaces:
com.codahale.metrics.Reservoir
public final class DeltaHdrHistogramReservoir extends java.lang.Object implements com.codahale.metrics.ReservoirA custom wrapping of snapshotting logic on the HdrHistogram. This histogram will always report the last histogram since it was most recently asked for with the getDeltaSnapshot(...) method. This provides local snapshot timing, but with a consistent view for reporting channels about what those snapshots most recently looked like.This implementation also supports attaching a single log writer. If a log writer is attached, each time an interval is snapshotted internally, the data will also be written to an hdr log via the writer.
-
-
Constructor Summary
Constructors Constructor Description DeltaHdrHistogramReservoir(java.lang.String name, int significantDigits)Create a reservoir with a default recorder.
-
Method Summary
Modifier and Type Method Description voidattachLogWriter(org.HdrHistogram.HistogramLogWriter logWriter)DeltaHdrHistogramReservoircopySettings()org.HdrHistogram.HistogramgetLastHistogram()com.codahale.metrics.SnapshotgetLastSnapshot()org.HdrHistogram.HistogramgetNextHdrHistogram()com.codahale.metrics.SnapshotgetSnapshot()intsize()voidupdate(long value)voidwrite(org.HdrHistogram.HistogramLogWriter writer)Write the last results via the log writer.
-
-
-
Constructor Detail
-
DeltaHdrHistogramReservoir
public DeltaHdrHistogramReservoir(java.lang.String name, int significantDigits)Create a reservoir with a default recorder. This recorder should be suitable for most usage.- Parameters:
name- the name to give to the reservoir, for logging purposessignificantDigits- how many significant digits to track in the reservoir
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfacecom.codahale.metrics.Reservoir
-
update
public void update(long value)
- Specified by:
updatein interfacecom.codahale.metrics.Reservoir
-
getSnapshot
public com.codahale.metrics.Snapshot getSnapshot()
- Specified by:
getSnapshotin interfacecom.codahale.metrics.Reservoir- Returns:
- the data accumulated since the reservoir was created, or since the last call to this method
-
getNextHdrHistogram
public org.HdrHistogram.Histogram getNextHdrHistogram()
-
getLastSnapshot
public com.codahale.metrics.Snapshot getLastSnapshot()
- Returns:
- last histogram snapshot that was provided by
getSnapshot()
-
write
public void write(org.HdrHistogram.HistogramLogWriter writer)
Write the last results via the log writer.- Parameters:
writer- the log writer to use
-
copySettings
public DeltaHdrHistogramReservoir copySettings()
-
attachLogWriter
public void attachLogWriter(org.HdrHistogram.HistogramLogWriter logWriter)
-
getLastHistogram
public org.HdrHistogram.Histogram getLastHistogram()
-
-