new CounterToRateMetricTransform(normalizationTransform, 60,
120, TimeUnit.SECONDS, manualClock);
manualClock.set(30000L);
c1.increment();
Metric m1 = new Metric(c1.getConfig(), manualClock.now(), c1.getValue(0));
toRateMetricTransform.update(ImmutableList.of(m1));
assertEquals(NormalizationTransform.HEARTBEAT_EXCEEDED.getValue(0).longValue(), 0);
List<Metric> o = observer.getObservations().get(0);
assertEquals(o.size(), 1);
manualClock.set(100000L);
Metric m2 = new Metric(c2.getConfig(), manualClock.now(), c2.getValue());
toRateMetricTransform.update(ImmutableList.of(m2));
assertEquals(NormalizationTransform.HEARTBEAT_EXCEEDED.getValue(0).longValue(), 0);
manualClock.set(160000L);
Metric m3 = new Metric(c3.getConfig(), manualClock.now(), c3.getValue());
toRateMetricTransform.update(ImmutableList.of(m3));
assertEquals(NormalizationTransform.HEARTBEAT_EXCEEDED.getValue(0).longValue(), 1);
}