Commit ce548198 authored by Simon Luser's avatar Simon Luser
Browse files

fixed metric visualization - only drawn if isValid()

parent d670b1de
...@@ -86,10 +86,10 @@ public class MetricChartAdapter implements MetricPlotAdapter { ...@@ -86,10 +86,10 @@ public class MetricChartAdapter implements MetricPlotAdapter {
} }
if (lowerPercentile > 0 && upperPercentile > 0) { if (lowerPercentile > 0 && upperPercentile > 0) {
Metric percUpperM = MetricAnalyzer.getMetric("P" Metric percUpperM = MetricAnalyzer.getMetric(
+ upperPercentile + "_" + metric.getName()); "P" + upperPercentile + "_" + metric.getName());
Metric percLowerM = MetricAnalyzer.getMetric("P" Metric percLowerM = MetricAnalyzer.getMetric(
+ lowerPercentile + "_" + metric.getName()); "P" + lowerPercentile + "_" + metric.getName());
if (percLowerM != null && percLowerM.isOverallMetric() if (percLowerM != null && percLowerM.isOverallMetric()
&& percUpperM != null && percUpperM.isOverallMetric()) { && percUpperM != null && percUpperM.isOverallMetric()) {
perc_lower = percLowerM.getOverallMetric(); perc_lower = percLowerM.getOverallMetric();
...@@ -108,25 +108,28 @@ public class MetricChartAdapter implements MetricPlotAdapter { ...@@ -108,25 +108,28 @@ public class MetricChartAdapter implements MetricPlotAdapter {
} }
if (avg != null) { if (avg != null) {
XYChart chart = view.createPlot(metric.getName() + " -- " XYChart chart = view.createPlot(
+ metric.getDescription()); metric.getName() + " -- " + metric.getDescription());
series = chart.getDataset().getSeries(0); series = chart.getDataset().getSeries(0);
// add, otherwise re-range is not working
series.add(0, 0, 0, 0);
if (maxItems > 0) { if (maxItems > 0) {
series.setMaximumItemCount(maxItems); series.setMaximumItemCount(maxItems);
} }
if (min != null) { if (min != null) {
chart.getDataset().addSeries(new YIntervalSeries("Min")); chart.getDataset().addSeries(new YIntervalSeries("Min"));
minSeries = chart.getDataset().getSeries( minSeries = chart.getDataset()
chart.getDataset().getSeriesCount() - 1); .getSeries(chart.getDataset().getSeriesCount() - 1);
if (maxItems > 0) { if (maxItems > 0) {
minSeries.setMaximumItemCount(maxItems); minSeries.setMaximumItemCount(maxItems);
} }
} }
if (max != null) { if (max != null) {
chart.getDataset().addSeries(new YIntervalSeries("Max")); chart.getDataset().addSeries(new YIntervalSeries("Max"));
maxSeries = chart.getDataset().getSeries( maxSeries = chart.getDataset()
chart.getDataset().getSeriesCount() - 1); .getSeries(chart.getDataset().getSeriesCount() - 1);
if (maxItems > 0) { if (maxItems > 0) {
maxSeries.setMaximumItemCount(maxItems); maxSeries.setMaximumItemCount(maxItems);
} }
...@@ -159,8 +162,9 @@ public class MetricChartAdapter implements MetricPlotAdapter { ...@@ -159,8 +162,9 @@ public class MetricChartAdapter implements MetricPlotAdapter {
varDown = 0; varDown = 0;
} }
} }
series.add(seconds, avgVal, Math.max(0, avgVal - varDown), avgVal if (avg.isValid())
+ varUp); series.add(seconds, avgVal, Math.max(0, avgVal - varDown),
avgVal + varUp);
} }
if (minSeries != null) { if (minSeries != null) {
double minV = scaledValue(min); double minV = scaledValue(min);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment