Package com.netflix.servo.publish

Examples of com.netflix.servo.publish.MetricPoller


        assertEquals(name, "HystrixCommand.GetLogs.simpleMonitor");
    }

    public static Metric getOSMetric(String name) throws Exception {
        MetricPoller poller = new JmxMetricPoller(new LocalJmxConnector(),
                new ObjectName("java.lang:type=OperatingSystem"), MATCH_NONE);

        RegexMetricFilter filter = new RegexMetricFilter(null,
                Pattern.compile(name), false, false);
        List<Metric> metrics = poller.poll(filter);
        assertEquals(metrics.size(), 1);
        return metrics.get(0);
    }
View Full Code Here


  public void start() throws Exception {
        final List<MetricObserver> observers = new ArrayList<MetricObserver>();
        observers.add(createGraphiteObserver());
        //observers.add(createCloudWatchObserver());

        final MetricPoller poller = new MonitorRegistryMetricPoller();
        final PollRunnable task = new PollRunnable(poller, BasicMetricFilter.MATCH_ALL, observers);

        PollScheduler.getInstance().start();
        PollScheduler.getInstance().addPoller(task, config.getLong("metrics.poll.interval", 30), TimeUnit.SECONDS);
  }
View Full Code Here

TOP

Related Classes of com.netflix.servo.publish.MetricPoller

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.