use of com.netflix.servo.monitor.PeakRateCounter in project tutorials by eugenp.
the class MetricTypeTest method givenPeakRateCounter_whenManipulate_thenPeakRateReturn.
@Test
public void givenPeakRateCounter_whenManipulate_thenPeakRateReturn() throws Exception {
Counter counter = new PeakRateCounter(MonitorConfig.builder("test").build());
assertEquals("counter should start with 0", 0, counter.getValue().intValue());
counter.increment();
SECONDS.sleep(1);
counter.increment();
counter.increment();
assertEquals("peak rate should have be 2", 2, counter.getValue().intValue());
}
Aggregations