Package 

Class LongGaugeMetric

  • All Implemented Interfaces:

    
    public final class LongGaugeMetric
    extends Metric<Long>
                        

    A long metric wrapper for Prometheus Gauges. Provides atomic operations such as incAndGet.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final String name
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getName() the name of this metric
      Long get() Supplies the current value of this metric.
      final Unit set(Long newValue) Atomically sets the gauge to the given value.
      final Unit inc() Atomically increments the value of this gauge by one.
      final Unit dec() Atomically decrements the value of this gauge by one.
      final Long addAndGet(Long delta) Atomically adds the given value to this gauge, returning the updated value.
      final Long incAndGet() Atomically increments the value of this gauge by one, returning the updated value.
      final Long decAndGet() Atomically decrements the value of this gauge by one, returning the updated value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

         Long get()

        Supplies the current value of this metric.

      • set

         final Unit set(Long newValue)

        Atomically sets the gauge to the given value.

      • inc

         final Unit inc()

        Atomically increments the value of this gauge by one.

      • dec

         final Unit dec()

        Atomically decrements the value of this gauge by one.

      • addAndGet

         final Long addAndGet(Long delta)

        Atomically adds the given value to this gauge, returning the updated value.

      • incAndGet

         final Long incAndGet()

        Atomically increments the value of this gauge by one, returning the updated value.

      • decAndGet

         final Long decAndGet()

        Atomically decrements the value of this gauge by one, returning the updated value.