brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Riak - More statistics
Date Mon, 23 Mar 2015 20:07:58 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/565#discussion_r26974110
  
    --- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java ---
    @@ -161,8 +162,15 @@ public void connectSensors() {
                                         }
                                     }
                             ))
    -                        .onFailureOrException(Functions.constant(Arrays.asList(new String[0]))))
    -                .build();
    +                        .onFailureOrException(Functions.constant(Arrays.asList(new String[0]))));
    +
    +        for(AttributeSensor<String> sensor : ONE_MINUTE_STRING_SENSORS) {
    +            httpFeedBuilder.poll(new HttpPollConfig<String>(sensor)
    +                    .onSuccess(HttpValueFunctions.jsonContents(sensor.getName(), String.class))
    +                    .onFailureOrException(Functions.constant("-1")));
    --- End diff --
    
    Why are we returning a string with a number in it? If these are numeric sensors, then
parse the results with `Integer#valueOf(String)` or similar, so they can be used in policies.


---
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