Permalink
Browse files

ignore null values in MultiReducedMetric

  • Loading branch information...
1 parent 5b62dc5 commit 99153f9374a213b268ac028c04a7ad9f42cb9f14 Jason Jackson committed Dec 7, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/jvm/backtype/storm/metric/api/MultiReducedMetric.java
View
5 src/jvm/backtype/storm/metric/api/MultiReducedMetric.java
@@ -23,7 +23,10 @@ public ReducedMetric scope(String key) {
public Object getValueAndReset() {
Map ret = new HashMap();
for(Map.Entry<String, ReducedMetric> e : _value.entrySet()) {
- ret.put(e.getKey(), e.getValue().getValueAndReset());
+ Object val = e.getValue().getValueAndReset();
+ if(val != null) {
+ ret.put(e.getKey(), val);
+ }
}
return ret;
}

0 comments on commit 99153f9

Please sign in to comment.