Commit f9c0399c authored by Björn Richerzhagen's avatar Björn Richerzhagen
Browse files

Fixed creation of live charts for percentiles

parent 472cf859
......@@ -70,10 +70,8 @@ public class MetricOutputLivePlot extends AbstractOutput implements
if (pView == null) {
pView = VisualizationInjector.createPlottingView("Metrics");
}
MetricChartAdapter mca = new MetricChartAdapter(metric, pView);
mca.lowerPercentile = lowerPercentile;
mca.upperPercentile = upperPercentile;
mca.maxItemCount = maxItemCount;
MetricChartAdapter mca = new MetricChartAdapter(metric, pView,
lowerPercentile, upperPercentile, maxItemCount);
charts.add(mca);
if (enableCDF && !metric.isOverallMetric()) {
if (pViewCdf == null) {
......@@ -106,8 +104,6 @@ public class MetricOutputLivePlot extends AbstractOutput implements
}
}
@Override
public void eventOccurred(Object se, int type) {
scheduleNext();
......
......@@ -35,14 +35,6 @@ import de.tudarmstadt.maki.simonstrator.api.common.metric.Metric.MetricValue;
*/
public class MetricChartAdapter implements MetricPlotAdapter {
private final int maxItems = 60;
public int upperPercentile = -1;
public int lowerPercentile = -1;
public int maxItemCount = -1;
private MetricValue<Number> std = null;
private MetricValue<Number> perc_lower = null;
......@@ -63,7 +55,21 @@ public class MetricChartAdapter implements MetricPlotAdapter {
private final Metric metric;
public MetricChartAdapter(Metric metric, PlottingView view) {
/**
*
* @param metric
* @param view
* @param upperPercentile
* upper percentile to be drawn, or -1 (you need to specify a
* matching percentile filter!)
* @param lowerPercentile
* lower percentile to be drawn, or -1 (you need to specify a
* matching percentile filter!)
* @param maxItems
* number of items to consider for min/max
*/
public MetricChartAdapter(Metric metric, PlottingView view,
int upperPercentile, int lowerPercentile, int maxItems) {
this.metric = metric;
if (metric.isOverallMetric()) {
MetricValue<?> mv = metric.getOverallMetric();
......@@ -106,14 +112,14 @@ public class MetricChartAdapter implements MetricPlotAdapter {
+ metric.getDescription());
series = chart.getDataset().getSeries(0);
if (maxItemCount > 0) {
if (maxItems > 0) {
series.setMaximumItemCount(maxItems);
}
if (min != null) {
chart.getDataset().addSeries(new YIntervalSeries("Min"));
minSeries = chart.getDataset().getSeries(
chart.getDataset().getSeriesCount() - 1);
if (maxItemCount > 0) {
if (maxItems > 0) {
minSeries.setMaximumItemCount(maxItems);
}
}
......@@ -121,7 +127,7 @@ public class MetricChartAdapter implements MetricPlotAdapter {
chart.getDataset().addSeries(new YIntervalSeries("Max"));
maxSeries = chart.getDataset().getSeries(
chart.getDataset().getSeriesCount() - 1);
if (maxItemCount > 0) {
if (maxItems > 0) {
maxSeries.setMaximumItemCount(maxItems);
}
}
......
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