org.apache.hadoop.metrics.MetricsServlet.TagsMetricsPair Java Examples

The following examples show how to use org.apache.hadoop.metrics.MetricsServlet.TagsMetricsPair. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestMetricsServlet.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public void testTagsMetricsPair() throws IOException {
  TagsMetricsPair pair = new TagsMetricsPair(outputRecord.getTagsCopy(), 
      outputRecord.getMetricsCopy());
  String s = JSON.toString(pair);
  assertEquals(
      "[{\"testTag1\":\"testTagValue1\",\"testTag2\":\"testTagValue2\"},"+
      "{\"testMetric1\":1,\"testMetric2\":33}]", s);
}
 
Example #2
Source File: TestMetricsServlet.java    From hadoop with Apache License 2.0 5 votes vote down vote up
public void testGetMap() throws IOException {
  MetricsServlet servlet = new MetricsServlet();
  Map<String, Map<String, List<TagsMetricsPair>>> m = servlet.makeMap(contexts);
  assertEquals("Map missing contexts", 2, m.size());
  assertTrue(m.containsKey("test1"));
 
  Map<String, List<TagsMetricsPair>> m2 = m.get("test1");
  
  assertEquals("Missing records", 1, m2.size());
  assertTrue(m2.containsKey("testRecord"));
  assertEquals("Wrong number of tags-values pairs.", 1, m2.get("testRecord").size());
}
 
Example #3
Source File: TestMetricsServlet.java    From big-c with Apache License 2.0 5 votes vote down vote up
public void testTagsMetricsPair() throws IOException {
  TagsMetricsPair pair = new TagsMetricsPair(outputRecord.getTagsCopy(), 
      outputRecord.getMetricsCopy());
  String s = JSON.toString(pair);
  assertEquals(
      "[{\"testTag1\":\"testTagValue1\",\"testTag2\":\"testTagValue2\"},"+
      "{\"testMetric1\":1,\"testMetric2\":33}]", s);
}
 
Example #4
Source File: TestMetricsServlet.java    From big-c with Apache License 2.0 5 votes vote down vote up
public void testGetMap() throws IOException {
  MetricsServlet servlet = new MetricsServlet();
  Map<String, Map<String, List<TagsMetricsPair>>> m = servlet.makeMap(contexts);
  assertEquals("Map missing contexts", 2, m.size());
  assertTrue(m.containsKey("test1"));
 
  Map<String, List<TagsMetricsPair>> m2 = m.get("test1");
  
  assertEquals("Missing records", 1, m2.size());
  assertTrue(m2.containsKey("testRecord"));
  assertEquals("Wrong number of tags-values pairs.", 1, m2.get("testRecord").size());
}
 
Example #5
Source File: TestMetricsServlet.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public void testTagsMetricsPair() throws IOException {
  TagsMetricsPair pair = new TagsMetricsPair(outputRecord.getTagsCopy(), 
      outputRecord.getMetricsCopy());
  String s = JSON.toString(pair);
  assertEquals(
      "[{\"testTag1\":\"testTagValue1\",\"testTag2\":\"testTagValue2\"},"+
      "{\"testMetric1\":1,\"testMetric2\":33}]", s);
}
 
Example #6
Source File: TestMetricsServlet.java    From RDFS with Apache License 2.0 5 votes vote down vote up
public void testGetMap() throws IOException {
  MetricsServlet servlet = new MetricsServlet();
  Map<String, Map<String, List<TagsMetricsPair>>> m = servlet.makeMap(contexts);
  assertEquals("Map missing contexts", 2, m.size());
  assertTrue(m.containsKey("test1"));
 
  Map<String, List<TagsMetricsPair>> m2 = m.get("test1");
  
  assertEquals("Missing records", 1, m2.size());
  assertTrue(m2.containsKey("testRecord"));
  assertEquals("Wrong number of tags-values pairs.", 1, m2.get("testRecord").size());
}