brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: fix time-sensitive sensor derivat...
Date Mon, 09 Feb 2015 14:06:10 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/501#discussion_r24329386
  
    --- Diff: policy/src/main/java/brooklyn/enricher/RollingTimeWindowMeanEnricher.java ---
    @@ -103,31 +119,69 @@ public void onEvent(SensorEvent<T> event) {
         public void onEvent(SensorEvent<T> event, long eventTime) {
             values.addLast(event.getValue());
             timestamps.addLast(eventTime);
    -        pruneValues(eventTime);
    -        entity.setAttribute((AttributeSensor<Double>)target, getAverage(eventTime).value);
//TODO this can potentially go stale... maybe we need to timestamp as well?
    +        if (eventTime>0) {
    +            ConfidenceQualifiedNumber average = getAverage(eventTime, 0);
    +
    +            if (average.confidence > getConfig(CONFIDENCE_REQUIRED_TO_PUBLISH)) {

    +                // without confidence, we might publish wildly varying estimates,
    +                // causing spurious resizes, so allow it to be configured, and
    +                // by default require a high value
    +
    +                // TODO would be nice to include timestamp, etc
    +                entity.setAttribute((AttributeSensor<Double>)target, average.value);

    +            }
    +        }
         }
         
         public ConfidenceQualifiedNumber getAverage() {
    --- End diff --
    
    Nothing seems to call the `getAverage()` method, so the `TIMESTAMP_GRACE_TIME` is never
used. Or am I missing something?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message