Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
f9c0399c
Commit
f9c0399c
authored
May 07, 2015
by
Björn Richerzhagen
Browse files
Fixed creation of live charts for percentiles
parent
472cf859
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/analyzer/metric/output/MetricOutputLivePlot.java
View file @
f9c0399c
...
...
@@ -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
();
...
...
src/de/tud/kom/p2psim/impl/topology/views/visualization/ui/MetricChartAdapter.java
View file @
f9c0399c
...
...
@@ -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
(
maxItem
Count
>
0
)
{
if
(
maxItem
s
>
0
)
{
series
.
setMaximumItemCount
(
maxItems
);
}
if
(
min
!=
null
)
{
chart
.
getDataset
().
addSeries
(
new
YIntervalSeries
(
"Min"
));
minSeries
=
chart
.
getDataset
().
getSeries
(
chart
.
getDataset
().
getSeriesCount
()
-
1
);
if
(
maxItem
Count
>
0
)
{
if
(
maxItem
s
>
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
(
maxItem
Count
>
0
)
{
if
(
maxItem
s
>
0
)
{
maxSeries
.
setMaximumItemCount
(
maxItems
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment