Interface Counter

All Superinterfaces:
Meter, Wrapper

public interface Counter extends Meter
Records a monotonically increasing value.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for a new counter.

    Nested classes/interfaces inherited from interface io.helidon.metrics.api.Meter

    Meter.BaseUnits, Meter.Id, Meter.Scope, Meter.Type
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new builder for a counter.
    long
    Returns the cumulative count since this counter was registered.
    void
    Updates the counter by one.
    void
    increment(long amount)
    Updates the counter by the specified amount which should be non-negative.

    Methods inherited from interface io.helidon.metrics.api.Meter

    baseUnit, description, id, scope, type

    Methods inherited from interface io.helidon.metrics.api.Wrapper

    unwrap
  • Method Details

    • builder

      static Counter.Builder builder(String name)
      Creates a new builder for a counter.
      Parameters:
      name - counter name
      Returns:
      new builder
    • increment

      void increment()
      Updates the counter by one.
    • increment

      void increment(long amount)
      Updates the counter by the specified amount which should be non-negative.
      Parameters:
      amount - amount to add to the counter.
    • count

      long count()
      Returns the cumulative count since this counter was registered.
      Returns:
      cumulative count since this counter was registered