Esempio n. 1
0
 @Test
 public void testPlotBandsWarning0() throws Exception {
   InterfaceLimit limit = new InterfaceLimit();
   limit.setWarning(0);
   limit.setCritical(50);
   ChartManager.setPlotBand(chart, limit);
   assertPlots(yAxis.getPlotBands(), 0, 0, 50, Integer.MAX_VALUE);
 }
Esempio n. 2
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. 3
0
 @Test
 public void testSetMetrics() throws Exception {
   IndicatorsModel model = new IndicatorsModel();
   model.setTimingMetricsMap(timingMetricsMap);
   ChartManager.setMetrics(chart, model);
   List<Series> series = conf.getSeries();
   assertEquals(2, series.size());
   DataSeries dataSeries1 = (DataSeries) series.get(0);
   DataSeries dataSeries2 = (DataSeries) series.get(1);
   assertEquals(METRIC1.getDescription(), dataSeries1.getName());
   assertEquals(METRIC2.getDescription(), dataSeries2.getName());
   DataSeriesItem item1 = dataSeries1.get(1);
   assertEquals(metricItem.getT95(), item1.getY());
   assertEquals(DATE_TIME2, new LocalDateTime(item1.getX(), DateTimeZone.UTC));
 }
Esempio n. 4
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());
 }
Esempio n. 5
0
 @Test
 public void testArithmeticMin() throws Exception {
   ChartManager.setLogarithmic(chart, false);
   assertEquals(0, yAxis.getMin());
 }
Esempio n. 6
0
 @Test
 public void testLogarithmicMin() throws Exception {
   ChartManager.setLogarithmic(chart, true);
   assertNull(yAxis.getMin());
 }
Esempio n. 7
0
 @Test
 public void testArithmeticMinorTickInterval() throws Exception {
   ChartManager.setLogarithmic(chart, false);
   assertNull(yAxis.getMinorTickInterval());
 }
Esempio n. 8
0
 @Test
 public void testLogarithmicMinorTickInterval() throws Exception {
   ChartManager.setLogarithmic(chart, true);
   assertEquals(0.1, yAxis.getMinorTickInterval());
 }
Esempio n. 9
0
 @Test
 public void testArithmeticType() throws Exception {
   ChartManager.setLogarithmic(chart, false);
   assertNull(yAxis.getType());
 }
Esempio n. 10
0
 @Test
 public void testLogarithmicType() throws Exception {
   ChartManager.setLogarithmic(chart, true);
   assertEquals(AxisType.LOGARITHMIC, yAxis.getType());
 }
Esempio n. 11
0
 @Test
 public void testPlotBandsNull() throws Exception {
   ChartManager.setPlotBand(chart, null);
   assertPlots(yAxis.getPlotBands(), 0);
 }