Package com.netflix.servo.util

Examples of com.netflix.servo.util.ManualClock.now()


                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);
View Full Code Here


        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());
View Full Code Here

        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);

    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.