Class Counter.Child

java.lang.Object
io.prometheus.client.Counter.Child
Enclosing class:
Counter

public static class Counter.Child extends Object
The value of a single Counter.

Warning: References to a Child become invalid after using SimpleCollector.remove(java.lang.String...) or SimpleCollector.clear(),

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final DoubleAdder
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    get()
    Get the value of the counter.
    void
    inc()
    Increment the counter by 1.
    void
    inc(double amt)
    Increment the counter by the given amount.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Child

      public Child()
  • Method Details

    • inc

      public void inc()
      Increment the counter by 1.
    • inc

      public void inc(double amt)
      Increment the counter by the given amount.
      Throws:
      IllegalArgumentException - If amt is negative.
    • get

      public double get()
      Get the value of the counter.