Interface LongCounter

All Superinterfaces:
Instrument

public interface LongCounter extends Instrument
A monotonically increasing metric that uses a long. Useful for integral values such as the number of bytes received, number of requests, etc.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final LongCounter
    Noop counter for use in tests.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add one to the current counter
    void
    incrementBy(long inc)
    Increment the counter
    void
    incrementBy(long inc, Map<String,Object> attributes)
    Increment the counter.

    Methods inherited from interface org.elasticsearch.telemetry.metric.Instrument

    getName
  • Field Details

    • NOOP

      static final LongCounter NOOP
      Noop counter for use in tests.
  • Method Details

    • increment

      void increment()
      Add one to the current counter
    • incrementBy

      void incrementBy(long inc)
      Increment the counter
      Parameters:
      inc - amount to increment
    • incrementBy

      void incrementBy(long inc, Map<String,Object> attributes)
      Increment the counter.
      Parameters:
      inc - amount to increment
      attributes - key-value pairs to associate with this increment