Package com.netflix.servo

Examples of com.netflix.servo.BasicMonitorRegistry


    private static final long ONE_MINUTE = 60 * 1000;
    private static final long ONE_HOUR = 60 * ONE_MINUTE;

    @Test
    public void testBasic() throws Exception {
        MonitorRegistry registry = new BasicMonitorRegistry();
        registry.register(Monitors.newCounter("test"));

        MetricPoller poller = new MonitorRegistryMetricPoller(registry);
        Metric metric = poller.poll(MATCH_ALL).get(0);
        MonitorConfig expected = MonitorConfig.builder("test")
            .withTag(DataSourceType.COUNTER)
View Full Code Here


        assertEquals(metric.getConfig(), expected);
    }

    @Test
    public void testSlowMonitor() throws Exception {
        MonitorRegistry registry = new BasicMonitorRegistry();
        registry.register(new SlowCounter("slow"));
        registry.register(Monitors.newCounter("test"));

        MetricPoller poller = new MonitorRegistryMetricPoller(registry);
        long start = System.currentTimeMillis();
        Metric metric = poller.poll(MATCH_ALL).get(0);
        long end = System.currentTimeMillis();
View Full Code Here

        assertEquals(metric.getConfig(), expected);
    }

    @Test(enabled = false)
    public void testShutdown() throws Exception {
        MonitorRegistry registry = new BasicMonitorRegistry();
        registry.register(Monitors.newCounter("test"));

        final String threadPrefix = "ServoMonitorGetValueLimiter";
        Thread.sleep(1000);
        int baseCount = countThreadsWithName(threadPrefix);
        MonitorRegistryMetricPoller[] pollers = new MonitorRegistryMetricPoller[10];
View Full Code Here

TOP

Related Classes of com.netflix.servo.BasicMonitorRegistry

Copyright © 2018 www.massapicom. 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.