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
9fab7de8
Commit
9fab7de8
authored
Jan 28, 2017
by
Björn Richerzhagen
Browse files
Fixed some NPS in Filter Toolchain for invalid derived metrics
parent
8b3f212a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/analyzer/metric/filter/AbstractFilter.java
View file @
9fab7de8
...
...
@@ -206,7 +206,9 @@ public abstract class AbstractFilter<M extends MetricValue<?>> implements
if
(
isOverallMetric
)
{
M
overall
=
getDerivedMetricValueFor
(
DerivedMetric
.
this
,
incoming
,
null
);
setOverallMetric
(
overall
);
if
(
overall
!=
null
)
{
setOverallMetric
(
overall
);
}
}
else
{
for
(
Host
host
:
hosts
)
{
M
perHost
=
getDerivedMetricValueFor
(
DerivedMetric
.
this
,
...
...
src/de/tud/kom/p2psim/impl/analyzer/metric/filter/StatisticsFilter.java
View file @
9fab7de8
...
...
@@ -83,14 +83,17 @@ public abstract class StatisticsFilter extends
Metric
<?>
derivedMetric
,
List
<
Metric
<?>>
inputs
,
Host
host
)
{
assert
inputs
.
size
()
==
1
;
assert
host
==
null
;
Metric
<?>
input
=
inputs
.
get
(
0
);
Metric
<?
extends
MetricValue
<?>
>
input
=
inputs
.
get
(
0
);
if
(
input
.
isOverallMetric
())
{
throw
new
AssertionError
(
"Only available for per-host input metrics."
);
}
LinkedList
<
MetricValue
>
mvs
=
new
LinkedList
<
MetricValue
>(
input
.
getAllPerHostMetrics
());
return
new
StatisticsMetricValue
(
mvs
);
List
<?
extends
MetricValue
<?>>
values
=
input
.
getAllPerHostMetrics
();
if
(
values
==
null
||
values
.
isEmpty
())
{
return
null
;
}
LinkedList
<
MetricValue
>
mvs
=
new
LinkedList
<
MetricValue
>(
values
);
return
new
StatisticsMetricValue
(
mvs
);
}
/**
...
...
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