-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BROOKLYN-569: aggregator casts vals to numbers #915
Conversation
Retest this please Test failure is unrelated:
|
for (Object val : vals) { | ||
Maybe<Number> coercedVal = TypeCoercions.tryCoerce(val, Number.class); | ||
if (coercedVal.isPresentAndNonNull()) { | ||
postProcessedVals.add(coercedVal.get()); | ||
count++; | ||
} else if (defaultValueForUnreportedSensors != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth a log.warn
saying the value if not coercible?
} else {
if (val!=null) {
log.warn("Input to numeric aggregator is not a number: "+val+" ("+val.getClass+")");
}
if (defaultValueForUnrepoertedSensors != null) {
...
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahgittin Done - but also guarding so we don't log repeatedly at warn. The aggregator might well get called every few seconds per enricher, so must avoid flooding the log with such warn messages.
@aledsage minor comment, merge when ready |
c41b3e7
to
e723851
Compare
Tested, LGTM, thanks @aledsage |
No description provided.