Class Histogram

java.lang.Object
io.dropwizard.metrics5.Histogram
All Implemented Interfaces:
Counting, Metric, Sampling, Summing

public class Histogram extends Object implements Metric, Sampling, Counting, Summing
A metric which calculates the distribution of a value.
See Also:
  • Constructor Details

    • Histogram

      public Histogram(Reservoir reservoir)
      Creates a new Histogram with the given reservoir.
      Parameters:
      reservoir - the reservoir to create a histogram from
  • Method Details

    • update

      public void update(int value)
      Adds a recorded value.
      Parameters:
      value - the length of the value
    • update

      public void update(long value)
      Adds a recorded value.
      Parameters:
      value - the length of the value
    • getCount

      public long getCount()
      Returns the number of values recorded.
      Specified by:
      getCount in interface Counting
      Returns:
      the number of values recorded
    • getSum

      public long getSum()
      Returns the sum of values recorded.
      Specified by:
      getSum in interface Summing
      Returns:
      the sum of values recorded
    • getSnapshot

      public Snapshot getSnapshot()
      Description copied from interface: Sampling
      Returns a snapshot of the values.
      Specified by:
      getSnapshot in interface Sampling
      Returns:
      a snapshot of the values