Class DeltaHdrHistogramReservoir
java.lang.Object
io.nosqlbench.nb.api.engine.metrics.DeltaHdrHistogramReservoir
- All Implemented Interfaces:
com.codahale.metrics.Reservoir,NBLabeledElement
public final class DeltaHdrHistogramReservoir
extends Object
implements com.codahale.metrics.Reservoir, NBLabeledElement
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
NBLabeledElement.BasicLabeledElement -
Field Summary
Fields inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionDeltaHdrHistogramReservoir(NBLabels labels, 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.nosqlbench.nb.api.labels.NBLabeledElement
description
-
Constructor Details
-
DeltaHdrHistogramReservoir
Create a reservoir with a default recorder. This recorder should be suitable for most usage.- Parameters:
labels- the labels 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() -
getLabels
- Specified by:
getLabelsin interfaceNBLabeledElement
-