Esempio n. 1
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");
 }
Esempio n. 2
0
 @Test
 public void testSetTimings() throws Exception {
   IndicatorsModel model = new IndicatorsModel();
   model.setTimingMetricsMap(timingMetricsMap);
   ChartManager.setTimings(chart, model);
   List<Series> series = conf.getSeries();
   assertEquals(6, series.size());
   assertEquals(TimingsType.MIN.getName(), series.get(0).getName());
   assertEquals(TimingsType.MAX.getName(), series.get(1).getName());
   assertEquals(TimingsType.AVG.getName(), series.get(2).getName());
   assertEquals(TimingsType.P90.getName(), series.get(3).getName());
   assertEquals(TimingsType.P95.getName(), series.get(4).getName());
   assertEquals(TimingsType.P99.getName(), series.get(5).getName());
   assertEquals(metricItem.getMin(), ((DataSeries) series.get(0)).get(1).getY());
   assertEquals(metricItem.getMax(), ((DataSeries) series.get(1)).get(1).getY());
   assertEquals(metricItem.getAvg(), ((DataSeries) series.get(2)).get(1).getY());
   assertEquals(metricItem.getT90(), ((DataSeries) series.get(3)).get(1).getY());
   assertEquals(metricItem.getT95(), ((DataSeries) series.get(4)).get(1).getY());
   assertEquals(metricItem.getT99(), ((DataSeries) series.get(5)).get(1).getY());
 }