tajoSystemMetrics.counter("test-group01", "test-item2").inc(2);
tajoSystemMetrics.counter("test-group02", "test-item1").inc(3);
}
SortedMap<String, Counter> counterMap = tajoSystemMetrics.getRegistry().getCounters();
Counter counter1 = counterMap.get("test-file-group.test-group01.test-item1");
assertNotNull(counter1);
assertEquals(10, counter1.getCount());
Counter counter2 = counterMap.get("test-file-group.test-group01.test-item2");
assertNotNull(counter2);
assertEquals(20, counter2.getCount());
//test findMetricsItemGroup method
Map<String, Map<String, Counter>> groupItems = reporter.findMetricsItemGroup(counterMap);
assertEquals(2, groupItems.size());
Map<String, Counter> group01Items = groupItems.get("test-file-group.test-group01");
assertEquals(2, group01Items.size());
counter1 = group01Items.get("test-item1");
assertNotNull(counter1);
assertEquals(10, counter1.getCount());
counter2 = group01Items.get("test-item2");
assertNotNull(counter2);
assertEquals(20, counter2.getCount());
Map<String, Counter> group02Items = groupItems.get("test-file-group.test-group02");
assertEquals(1, group02Items.size());
reporter.report();