Esempio n. 1
0
 @Test
 public void testSetCounts() throws Exception {
   IndicatorsModel model = new IndicatorsModel();
   model.setTimingMetricsMap(timingMetricsMap);
   ChartManager.setCounts(chart, model);
   List<Series> series = conf.getSeries();
   assertEquals(2, series.size());
   assertEquals(TimingsType.QUERIES.getName(), series.get(0).getName());
   assertEquals(TimingsType.ERRORS.getName(), series.get(1).getName());
   assertEquals(metricItem.getCount(), ((DataSeries) series.get(0)).get(1).getY());
   assertEquals(metricItem.getErrorCount(), ((DataSeries) series.get(1)).get(1).getY());
 }
Esempio n. 2
0
 @Test
 public void testTotal() throws Exception {
   table.setItems(items);
   assertItemAndValue(TimingsTable.PERIOD, TimingsTable.TOTAL);
   assertItemAndValue(TimingsType.MIN.getName(), "5");
   assertItemAndValue(TimingsType.MAX.getName(), "10");
   assertItemAndValue(TimingsType.AVG.getName(), "26");
   assertItemAndValue(TimingsType.P90.getName(), "19");
   assertItemAndValue(TimingsType.P95.getName(), "13");
   assertItemAndValue(TimingsType.P99.getName(), "25");
   assertItemAndValue(TimingsType.QUERIES.getName(), "7");
   assertItemAndValue(TimingsType.ERRORS.getName(), "17");
 }