Package io.nosqlbench.api.engine.metrics
Class DeltaHdrHistogramReservoir
java.lang.Object
io.nosqlbench.api.engine.metrics.DeltaHdrHistogramReservoir
- All Implemented Interfaces:
com.codahale.metrics.Reservoir
public final class DeltaHdrHistogramReservoir
extends Object
implements com.codahale.metrics.Reservoir
A 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
ConstructorsConstructorDescriptionDeltaHdrHistogramReservoir(String name, int significantDigits) Create a reservoir with a default recorder. -
Method Summary
Modifier and TypeMethodDescriptionvoidattachLogWriter(org.HdrHistogram.HistogramLogWriter logWriter) org.HdrHistogram.Histogramcom.codahale.metrics.Snapshotorg.HdrHistogram.Histogramcom.codahale.metrics.Snapshotintsize()voidupdate(long value) voidwrite(org.HdrHistogram.HistogramLogWriter writer) Write the last results via the log writer.
-
Constructor Details
-
DeltaHdrHistogramReservoir
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 Details
-
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
-
attachLogWriter
public void attachLogWriter(org.HdrHistogram.HistogramLogWriter logWriter) -
getLastHistogram
public org.HdrHistogram.Histogram getLastHistogram()
-