Fix bug where MovAvgReducer would allow NaN's to "corrupt" the moving avg
This commit is contained in:
parent
114d10e5a9
commit
a218d59ce1
|
@ -115,10 +115,9 @@ public class MovAvgReducer extends Reducer {
|
||||||
Double thisBucketValue = resolveBucketValue(histo, bucket, bucketsPaths()[0], gapPolicy);
|
Double thisBucketValue = resolveBucketValue(histo, bucket, bucketsPaths()[0], gapPolicy);
|
||||||
currentKey = bucket.getKey();
|
currentKey = bucket.getKey();
|
||||||
|
|
||||||
if (thisBucketValue != null) {
|
if (!(thisBucketValue == null || thisBucketValue.equals(Double.NaN))) {
|
||||||
values.offer(thisBucketValue);
|
values.offer(thisBucketValue);
|
||||||
|
|
||||||
// TODO handle "edge policy"
|
|
||||||
double movavg = model.next(values);
|
double movavg = model.next(values);
|
||||||
|
|
||||||
List<InternalAggregation> aggs = new ArrayList<>(Lists.transform(bucket.getAggregations().asList(), FUNCTION));
|
List<InternalAggregation> aggs = new ArrayList<>(Lists.transform(bucket.getAggregations().asList(), FUNCTION));
|
||||||
|
|
Loading…
Reference in New Issue