Table of Contents

What is a Timer Monitoring Metrics?

About

A Timer is a metrics type that sends two values:

Example

Suppose:

Then for the first interval:

Therefore:

Type

Background Task

As a timer reports the total time, a timer may not send any record until the task is complete.

Interval

A timer may be calculated at intervals.

Library

Micrometer

Timer timer = Timer
  .builder("my.timer")
  .description("a description of what this timer does")
  .register(registry);

vertx.setPeriodic(1000, l -> {
  timer.record(() -> {
    // Running here some operation to monitor
  });
});