Interface Gauge

All Superinterfaces:
Metric

public interface Gauge extends Metric
A value that goes up and down, such as downstream_cx_active. Gauges made by a registry hold an AtomicLong, or read a supplier when the value lives elsewhere (StatsRegistry.gauge(String, String, java.util.function.LongSupplier)), which cannot be changed through the gauge; those of StatsRegistry.NOOP do nothing.
  • Nested Class Summary

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

    Metric.Type
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(long delta)
    Adds delta, which may be negative.
    default void
    dec()
    Subtracts one.
    default void
    inc()
    Adds one.
    void
    set(long value)
    Sets the value.
    default Metric.Type
    Returns what kind of metric this is.
    long
    Returns the current value.

    Methods inherited from interface org.microproxy.stats.Metric

    help, name, tagExtractedName, tags
  • Method Details

    • set

      void set(long value)
      Sets the value.
      Parameters:
      value - the new value
      Throws:
      UnsupportedOperationException - for a gauge that reads a supplier
    • add

      void add(long delta)
      Adds delta, which may be negative.
      Parameters:
      delta - how much to add
      Throws:
      UnsupportedOperationException - for a gauge that reads a supplier
    • inc

      default void inc()
      Adds one.
      Throws:
      UnsupportedOperationException - for a gauge that reads a supplier
    • dec

      default void dec()
      Subtracts one.
      Throws:
      UnsupportedOperationException - for a gauge that reads a supplier
    • value

      long value()
      Returns the current value.
      Returns:
      the current value
    • 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