Class SlidingTimeWindowReservoir

java.lang.Object
org.axonframework.extension.metrics.micrometer.reservoir.SlidingTimeWindowReservoir

public class SlidingTimeWindowReservoir extends Object
A reservoir of measurements constrained by a sliding window that stores only the measurements made in the last N seconds (or other time unit).

Adapted from com.codahale.metrics.SlidingTimeWindowReservoir from io.dropwizard.metrics:metrics-core:3.1.2

Since:
4.1
Author:
Volker Fritzsch, Coda Hale, ceetav, Marijn van Zelst
  • Constructor Details

    • SlidingTimeWindowReservoir

      public SlidingTimeWindowReservoir(long window, TimeUnit windowUnit, io.micrometer.core.instrument.Clock clock)
      Creates a new SlidingTimeWindowReservoir with the given clock and window of time.
      Parameters:
      window - the window of time
      windowUnit - the unit of window
      clock - the Clock to use
  • Method Details

    • update

      public void update(long value)
      Add new measurement value
      Parameters:
      value - the measurement value
    • getMeasurements

      public List<Long> getMeasurements()
      Retrieve the measurements
      Returns:
      the measurements