@Test
  public void testBasic() throws Exception {
    MonitorRegistry registry = new BasicMonitorRegistry();
    registry.registerObject(new BasicCounter("foo"));

    MetricPoller poller = new MonitorRegistryMetricPoller(registry);
    Metric metric = poller.poll(MATCH_ALL).get(0);
    TagList tags =
        BasicTagList.copyOf(
            new BasicTag("MonitorId", "foo"),
            new BasicTag("ClassName", "com.netflix.servo.util.BasicCounter"),
            DataSourceType.COUNTER);
    assertEquals(metric.getConfig(), new MetricConfig("Count", tags));
  }
示例#2
0
 public TagList getTags(Socket s) {
   String country = COUNTRIES[r.nextInt(COUNTRIES.length)];
   return BasicTagList.copyOf(new BasicTag("Country", country));
 }