Beispiel #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);
 }
Beispiel #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());
 }
Beispiel #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));
 }
Beispiel #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());
 }
Beispiel #5
0
 @Test
 public void testArithmeticMin() throws Exception {
   ChartManager.setLogarithmic(chart, false);
   assertEquals(0, yAxis.getMin());
 }
Beispiel #6
0
 @Test
 public void testLogarithmicMin() throws Exception {
   ChartManager.setLogarithmic(chart, true);
   assertNull(yAxis.getMin());
 }
Beispiel #7
0
 @Test
 public void testArithmeticMinorTickInterval() throws Exception {
   ChartManager.setLogarithmic(chart, false);
   assertNull(yAxis.getMinorTickInterval());
 }
Beispiel #8
0
 @Test
 public void testLogarithmicMinorTickInterval() throws Exception {
   ChartManager.setLogarithmic(chart, true);
   assertEquals(0.1, yAxis.getMinorTickInterval());
 }
Beispiel #9
0
 @Test
 public void testArithmeticType() throws Exception {
   ChartManager.setLogarithmic(chart, false);
   assertNull(yAxis.getType());
 }
Beispiel #10
0
 @Test
 public void testLogarithmicType() throws Exception {
   ChartManager.setLogarithmic(chart, true);
   assertEquals(AxisType.LOGARITHMIC, yAxis.getType());
 }
Beispiel #11
0
 @Test
 public void testPlotBandsNull() throws Exception {
   ChartManager.setPlotBand(chart, null);
   assertPlots(yAxis.getPlotBands(), 0);
 }