Interface Histogram

All Superinterfaces:
Metric

public interface Histogram extends Metric
A distribution of recorded values in fixed buckets, such as downstream_rq_time: one LongAdder per bucket, plus the sum and the count of the values, so recording takes no lock and allocates nothing. Times are recorded in milliseconds.

A bucket is named by its upper bound, which it includes (Prometheus's le); values above the last bound fall in the +Inf bucket. The default bounds (defaultBounds()) are Envoy's: 0.5, 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 300000, 600000, 1800000 and 3600000.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    The counts of a histogram at one moment.

    Nested classes/interfaces inherited from interface org.microproxy.stats.Metric

    Metric.Type
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    Returns a copy of Envoy's default bucket bounds, in milliseconds.
    static double[]
    Returns bucket bounds for short durations in microseconds, such as a hook's run: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000 and 1000000.
    void
    record(double value)
    Records value.
    default void
    recordNanos(long nanos)
    Records a duration measured in nanoseconds, in milliseconds.
    Returns the counts so far, read bucket by bucket (not atomically as a whole).
    default Metric.Type
    Returns what kind of metric this is.

    Methods inherited from interface org.microproxy.stats.Metric

    help, name, tagExtractedName, tags
  • Method Details

    • record

      void record(double value)
      Records value.
      Parameters:
      value - the value, in the histogram's unit (milliseconds for times)
    • recordNanos

      default void recordNanos(long nanos)
      Records a duration measured in nanoseconds, in milliseconds.
      Parameters:
      nanos - the duration in nanoseconds
    • snapshot

      Histogram.Snapshot snapshot()
      Returns the counts so far, read bucket by bucket (not atomically as a whole).
      Returns:
      the counts so far, read bucket by bucket (not atomically as a whole)
    • type

      default Metric.Type type()
      Description copied from interface: Metric
      Returns what kind of metric this is.
      Specified by:
      type in interface Metric
      Returns:
      what kind of metric this is
    • defaultBounds

      static double[] defaultBounds()
      Returns a copy of Envoy's default bucket bounds, in milliseconds.
      Returns:
      a copy of Envoy's default bucket bounds, in milliseconds
    • microsecondBounds

      static double[] microsecondBounds()
      Returns bucket bounds for short durations in microseconds, such as a hook's run: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000 and 1000000.
      Returns:
      bucket bounds for short durations in microseconds, such as a hook's run: 1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000 and 1000000