Class CumulativeSum

java.lang.Object
org.apache.kafka.common.metrics.stats.CumulativeSum
All Implemented Interfaces:
Measurable, MeasurableStat, MetricValueProvider<Double>, Stat
Direct Known Subclasses:
CumulativeCount

public class CumulativeSum
extends Object
implements MeasurableStat
An non-sampled cumulative total maintained over all time. This is a non-sampled version of WindowedSum. See also CumulativeCount if you just want to increment the value by 1 on each recording.
  • Constructor Details

    • CumulativeSum

      public CumulativeSum()
    • CumulativeSum

      public CumulativeSum​(double value)
  • Method Details

    • record

      public void record​(MetricConfig config, double value, long now)
      Description copied from interface: Stat
      Record the given value
      Specified by:
      record in interface Stat
      Parameters:
      config - The configuration to use for this metric
      value - The value to record
      now - The POSIX time in milliseconds this value occurred
    • measure

      public double measure​(MetricConfig config, long now)
      Description copied from interface: Measurable
      Measure this quantity and return the result as a double
      Specified by:
      measure in interface Measurable
      Parameters:
      config - The configuration for this metric
      now - The POSIX time in milliseconds the measurement is being taken
      Returns:
      The measured value
    • toString

      public String toString()
      Overrides:
      toString in class Object