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 {
}
if (lowerPercentile > 0 && upperPercentile > 0) {
Metric percUpperM = MetricAnalyzer.getMetric("P"
+ upperPercentile + "_" + metric.getName());
Metric percLowerM = MetricAnalyzer.getMetric("P"
+ lowerPercentile + "_" + metric.getName());
Metric percUpperM = MetricAnalyzer.getMetric(
"P" + upperPercentile + "_" + metric.getName());
Metric percLowerM = MetricAnalyzer.getMetric(
"P" + lowerPercentile + "_" + metric.getName());
if (percLowerM != null && percLowerM.isOverallMetric()
&& percUpperM != null && percUpperM.isOverallMetric()) {
perc_lower = percLowerM.getOverallMetric();
......@@ -108,25 +108,28 @@ public class MetricChartAdapter implements MetricPlotAdapter {
}
if (avg != null) {
XYChart chart = view.createPlot(metric.getName() + " -- "
+ metric.getDescription());
XYChart chart = view.createPlot(
metric.getName() + " -- " + metric.getDescription());
series = chart.getDataset().getSeries(0);
// add, otherwise re-range is not working
series.add(0, 0, 0, 0);
if (maxItems > 0) {
series.setMaximumItemCount(maxItems);
}
if (min != null) {
chart.getDataset().addSeries(new YIntervalSeries("Min"));
minSeries = chart.getDataset().getSeries(
chart.getDataset().getSeriesCount() - 1);
minSeries = chart.getDataset()
.getSeries(chart.getDataset().getSeriesCount() - 1);
if (maxItems > 0) {
minSeries.setMaximumItemCount(maxItems);
}
}
if (max != null) {
chart.getDataset().addSeries(new YIntervalSeries("Max"));
maxSeries = chart.getDataset().getSeries(
chart.getDataset().getSeriesCount() - 1);
maxSeries = chart.getDataset()
.getSeries(chart.getDataset().getSeriesCount() - 1);
if (maxItems > 0) {
maxSeries.setMaximumItemCount(maxItems);
}
......@@ -159,8 +162,9 @@ public class MetricChartAdapter implements MetricPlotAdapter {
varDown = 0;
}
}
series.add(seconds, avgVal, Math.max(0, avgVal - varDown), avgVal
+ varUp);
if (avg.isValid())
series.add(seconds, avgVal, Math.max(0, avgVal - varDown),
avgVal + varUp);
}
if (minSeries != null) {
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