Package io.nosqlbench.engine.api.metrics
Class HistoStatsLogger
java.lang.Object
io.nosqlbench.engine.api.metrics.CapabilityHook<HdrDeltaHistogramAttachment>
io.nosqlbench.engine.api.metrics.HistoStatsLogger
- All Implemented Interfaces:
com.codahale.metrics.MetricRegistryListener,MetricsCloseable,java.lang.Runnable,java.util.EventListener
public class HistoStatsLogger extends CapabilityHook<HdrDeltaHistogramAttachment> implements java.lang.Runnable, MetricsCloseable
HistoIntervalLogger runs a separate thread to snapshotAndWrite encoded histograms on a regular interval.
It listens to the metrics registry for any new metrics that match the pattern. Any metrics
which both match the pattern and which are
EncodableHistograms are written the configured
logfile at the configured interval.-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description HistoStatsLogger(java.lang.String sessionName, java.io.File file, java.util.regex.Pattern pattern, long intervalLength, java.util.concurrent.TimeUnit timeUnit) -
Method Summary
Modifier and Type Method Description voidchart()voidcloseMetrics()protected java.lang.Class<HdrDeltaHistogramAttachment>getCapabilityClass()longgetInterval()booleanmatches(java.lang.String metricName)voidonCapableAdded(java.lang.String name, HdrDeltaHistogramAttachment chainedHistogram)voidonCapableRemoved(java.lang.String name, HdrDeltaHistogramAttachment capable)voidrun()voidstartLogging()By convention, it is typical for the logging application to use a comment to indicate the logging application at the head of the log, followed by the log format version, a startLogging time, and a legend (in that order).java.lang.StringtoString()Methods inherited from class io.nosqlbench.engine.api.metrics.CapabilityHook
onCounterAdded, onCounterRemoved, onGaugeAdded, onGaugeRemoved, onHistogramAdded, onHistogramRemoved, onMeterAdded, onMeterRemoved, onTimerAdded, onTimerRemoved
-
Constructor Details
-
HistoStatsLogger
public HistoStatsLogger(java.lang.String sessionName, java.io.File file, java.util.regex.Pattern pattern, long intervalLength, java.util.concurrent.TimeUnit timeUnit)
-
-
Method Details
-
matches
public boolean matches(java.lang.String metricName) -
startLogging
public void startLogging()By convention, it is typical for the logging application to use a comment to indicate the logging application at the head of the log, followed by the log format version, a startLogging time, and a legend (in that order). -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
getInterval
public long getInterval() -
onCapableAdded
- Specified by:
onCapableAddedin classCapabilityHook<HdrDeltaHistogramAttachment>
-
onCapableRemoved
- Specified by:
onCapableRemovedin classCapabilityHook<HdrDeltaHistogramAttachment>
-
getCapabilityClass
- Specified by:
getCapabilityClassin classCapabilityHook<HdrDeltaHistogramAttachment>
-
run
public void run()- Specified by:
runin interfacejava.lang.Runnable
-
closeMetrics
public void closeMetrics()- Specified by:
closeMetricsin interfaceMetricsCloseable
-
chart
public void chart()- Specified by:
chartin interfaceMetricsCloseable
-