Class Counter


  • public class Counter
    extends Meter
    A counter is used to track and record metrics related to counted items such as processed requests, bytes read, or bytes written. Counted data must be monotonically increasing. Counters cannot appear to move backwards except on reset or wrap.
    • Constructor Detail

      • Counter

        public Counter()
        Default constructor.
      • Counter

        @ConstructorProperties({"reading","currentValue","description","unit"})
        public Counter​(CounterReading reading,
                       long currentValue,
                       java.lang.String description,
                       java.lang.String unit)
        Constructor used during construction of proxy objects for MXBeans.
    • Method Detail

      • getCurrentValue

        public long getCurrentValue()
        Returns:
        current counter value
      • getReading

        public CounterReading getReading()
        Returns:
        a snapshot of the counter value
      • getDescription

        public java.lang.String getDescription()
        Overrides:
        getDescription in class Meter
        Returns:
        description of the counter
      • getUnit

        public java.lang.String getUnit()
        Overrides:
        getUnit in class Meter
        Returns:
        unit of measurement for the counter