GitHub PullRequestReviewCommentEvent at 2014-03-16 03:11:42
Repository: brooklyn
Actor: grkvlt
Payload: {"comment":{"url":"https://api.github.com/repos/brooklyncentral/brooklyn/pulls/comments/10637797","id":10637797,"diff_hunk":"@@ -4,126 +4,62 @@\n import java.lang.management.MemoryUsage;\n import java.util.concurrent.TimeUnit;\n \n+import javax.annotation.Nonnull;\n+import javax.annotation.Nullable;\n import javax.management.openmbean.CompositeData;\n \n import brooklyn.enricher.RollingTimeWindowMeanEnricher;\n import brooklyn.enricher.TimeFractionDeltaEnricher;\n+import brooklyn.entity.Entity;\n import brooklyn.entity.basic.EntityLocal;\n import brooklyn.event.feed.http.HttpValueFunctions;\n import brooklyn.event.feed.jmx.JmxAttributePollConfig;\n import brooklyn.event.feed.jmx.JmxFeed;\n+import brooklyn.util.math.MathFunctions;\n import brooklyn.util.time.Duration;\n \n import com.google.common.base.Function;\n \n public class JavaAppUtils {\n \n+    private static boolean isEntityMxBeanStatsEnabled(Entity entity) {\n+        return Boolean.TRUE.equals(entity.getConfig(UsesJavaMXBeans.MXBEAN_STATS_ENABLED));\n+    }\n+\n+    /**\n+     * @see #connectJavaAppServerPolicies(EntityLocal, Duration)\n+     * @see #getMxBeanSensorsBuilder(EntityLocal)\n+     */\n+    @Nullable\n     public static JmxFeed connectMXBeanSensors(EntityLocal entity) {\n-        return connectMXBeanSensors(entity, Duration.FIVE_SECONDS);\n+        if (isEntityMxBeanStatsEnabled(entity)) return null;","path":"software/base/src/main/java/brooklyn/entity/java/JavaAppUtils.java","position":33,"original_position":33,"commit_id":"dd276ae672f589c458c256fee68f4185580a1d2e","original_commit_id":"dd276ae672f589c458c256fee68f4185580a1d2e","user":{"login":"grkvlt","id":214870,"avatar_url":"https://gravatar.com/avatar/0d60dc3551d901690d5820a23a96d771?d=https%3A%2F%2Fidenticons.github.com%2F2cc56f05c2acca03f19f129dd89d04a1.png&r=x","gravatar_id":"0d60dc3551d901690d5820a23a96d771","url":"https://api.github.com/users/grkvlt","html_url":"https://github.com/grkvlt","followers_url":"https://api.github.com/users/grkvlt/followers","following_url":"https://api.github.com/users/grkvlt/following{/other_user}","gists_url":"https://api.github.com/users/grkvlt/gists{/gist_id}","starred_url":"https://api.github.com/users/grkvlt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grkvlt/subscriptions","organizations_url":"https://api.github.com/users/grkvlt/orgs","repos_url":"https://api.github.com/users/grkvlt/repos","events_url":"https://api.github.com/users/grkvlt/events{/privacy}","received_events_url":"https://api.github.com/users/grkvlt/received_events","type":"User","site_admin":false},"body":"Oops. Don't know how I managed to miss that when reviewing...! Fixed in #1258 anyway.","created_at":"2014-03-16T03:11:42Z","updated_at":"2014-03-16T03:11:42Z","html_url":"https://github.com/brooklyncentral/brooklyn/pull/1252#discussion_r10637797","pull_request_url":"https://api.github.com/repos/brooklyncentral/brooklyn/pulls/1252","_links":{"self":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn/pulls/comments/10637797"},"html":{"href":"https://github.com/brooklyncentral/brooklyn/pull/1252#discussion_r10637797"},"pull_request":{"href":"https://api.github.com/repos/brooklyncentral/brooklyn/pulls/1252"}}}}