Class DataSketchesOpStatsLogger
- java.lang.Object
-
- org.apache.bookkeeper.stats.prometheus.DataSketchesOpStatsLogger
-
- All Implemented Interfaces:
OpStatsLogger
public class DataSketchesOpStatsLogger extends java.lang.Object implements OpStatsLogger
OpStatsLogger implementation that uses DataSketches library to calculate the approximated latency quantiles.
-
-
Constructor Summary
Constructors Constructor Description DataSketchesOpStatsLogger(java.util.Map<java.lang.String,java.lang.String> labels)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear stats for this operation.longgetCount(boolean success)java.util.Map<java.lang.String,java.lang.String>getLabels()doublegetQuantileValue(boolean success, double quantile)longgetSum(boolean success)voidinitializeThread(java.util.Map<java.lang.String,java.lang.String> labels)booleanisThreadInitialized()voidregisterFailedEvent(long eventLatency, java.util.concurrent.TimeUnit unit)Increment the failed op counter with the given eventLatency.voidregisterFailedValue(long value)An operation with the given value failed.voidregisterSuccessfulEvent(long eventLatency, java.util.concurrent.TimeUnit unit)An operation succeeded with the given eventLatency.voidregisterSuccessfulValue(long value)An operation with the given value succeeded.voidrotateLatencyCollection()OpStatsDatatoOpStatsData()java.lang.StringtoString()
-
-
-
Method Detail
-
registerFailedEvent
public void registerFailedEvent(long eventLatency, java.util.concurrent.TimeUnit unit)Description copied from interface:OpStatsLoggerIncrement the failed op counter with the given eventLatency.- Specified by:
registerFailedEventin interfaceOpStatsLogger- Parameters:
eventLatency- The event latency
-
registerSuccessfulEvent
public void registerSuccessfulEvent(long eventLatency, java.util.concurrent.TimeUnit unit)Description copied from interface:OpStatsLoggerAn operation succeeded with the given eventLatency. Update stats to reflect the same- Specified by:
registerSuccessfulEventin interfaceOpStatsLogger- Parameters:
eventLatency- The event latency
-
registerSuccessfulValue
public void registerSuccessfulValue(long value)
Description copied from interface:OpStatsLoggerAn operation with the given value succeeded.- Specified by:
registerSuccessfulValuein interfaceOpStatsLogger
-
registerFailedValue
public void registerFailedValue(long value)
Description copied from interface:OpStatsLoggerAn operation with the given value failed.- Specified by:
registerFailedValuein interfaceOpStatsLogger
-
toOpStatsData
public OpStatsData toOpStatsData()
- Specified by:
toOpStatsDatain interfaceOpStatsLogger- Returns:
- Returns an OpStatsData object with necessary values. We need this function to support JMX exports. This should be deprecated sometime in the near future. populated.
-
clear
public void clear()
Description copied from interface:OpStatsLoggerClear stats for this operation.- Specified by:
clearin interfaceOpStatsLogger
-
rotateLatencyCollection
public void rotateLatencyCollection()
-
getCount
public long getCount(boolean success)
-
getSum
public long getSum(boolean success)
-
getQuantileValue
public double getQuantileValue(boolean success, double quantile)
-
getLabels
public java.util.Map<java.lang.String,java.lang.String> getLabels()
-
isThreadInitialized
public boolean isThreadInitialized()
-
initializeThread
public void initializeThread(java.util.Map<java.lang.String,java.lang.String> labels)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-