Monitoring Metrics - Counter (Increasing counter)

> Monitoring Metrics (Perfcounter | Performance Metrics | Operational data)

1 - About

A counter is a metrics type that increments its value generally by one starting from 0.

A counter will drop back to zero on service restart. Representing a counter without rate aggregation over some time window is rarely useful, as the representation is a function of both:

  • the rapidity with which the counter is incremented
  • and the longevity of the service.

Increasing counter starts at zero, increasing when an action occurs. This type of counter will probably have a maximum value. If this value is reached, the counter starts over at zero. This is the same as many counters in the world such as the mileage counter in a car.


3 - Usage

Counter are used to measure the rate at which some event is occurring over a given time interval. (ie Performance - (Throughput|Bandwidth|Transfer rate|Frequency))

Example: in a queue, counters can measure things like the rate at which items are being inserted and removed.

4 - Example

4.1 - Micrometer

Counter counter = Counter
    .baseUnit("beans") // optional
    .description("a description of what this counter does") // optional
    .tags("region", "test") // optional

5 - Documentation