Class DataSketchesOpStatsLogger

java.lang.Object
org.apache.bookkeeper.stats.prometheus.DataSketchesOpStatsLogger
All Implemented Interfaces:
OpStatsLogger

public class DataSketchesOpStatsLogger extends Object implements OpStatsLogger
OpStatsLogger implementation that uses DataSketches library to calculate the approximated latency quantiles.
  • Constructor Details

    • DataSketchesOpStatsLogger

      public DataSketchesOpStatsLogger(Map<String,String> labels)
  • Method Details

    • registerFailedEvent

      public void registerFailedEvent(long eventLatency, TimeUnit unit)
      Description copied from interface: OpStatsLogger
      Increment the failed op counter with the given eventLatency.
      Specified by:
      registerFailedEvent in interface OpStatsLogger
      Parameters:
      eventLatency - The event latency
    • registerSuccessfulEvent

      public void registerSuccessfulEvent(long eventLatency, TimeUnit unit)
      Description copied from interface: OpStatsLogger
      An operation succeeded with the given eventLatency. Update stats to reflect the same
      Specified by:
      registerSuccessfulEvent in interface OpStatsLogger
      Parameters:
      eventLatency - The event latency
    • registerSuccessfulValue

      public void registerSuccessfulValue(long value)
      Description copied from interface: OpStatsLogger
      An operation with the given value succeeded.
      Specified by:
      registerSuccessfulValue in interface OpStatsLogger
    • registerFailedValue

      public void registerFailedValue(long value)
      Description copied from interface: OpStatsLogger
      An operation with the given value failed.
      Specified by:
      registerFailedValue in interface OpStatsLogger
    • toOpStatsData

      public OpStatsData toOpStatsData()
      Specified by:
      toOpStatsData in interface OpStatsLogger
      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: OpStatsLogger
      Clear stats for this operation.
      Specified by:
      clear in interface OpStatsLogger
    • 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 Map<String,String> getLabels()
    • isThreadInitialized

      public boolean isThreadInitialized()
    • initializeThread

      public void initializeThread(Map<String,String> labels)
    • toString

      public String toString()
      Overrides:
      toString in class Object