nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegz <...@git.apache.org>
Subject [GitHub] nifi pull request #328: NIFI-1690 Changed MonitorMemory to use allowable val...
Date Wed, 15 Jun 2016 12:12:03 GMT
Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/328#discussion_r67149454
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-reporting-tasks/src/main/java/org/apache/nifi/controller/MonitorMemory.java
---
    @@ -91,12 +92,21 @@
             + " that the memory pool is exceeding this threshold.")
     public class MonitorMemory extends AbstractReportingTask {
     
    +    private static final AllowableValue[] memPoolAllowableValues;
    +
    +    static {
    +        List<MemoryPoolMXBean> memoryPoolBeans = ManagementFactory.getMemoryPoolMXBeans();
    +        memPoolAllowableValues = new AllowableValue[memoryPoolBeans.size()];
    +        for (int i = 0; i < memPoolAllowableValues.length; i++) {
    +            memPoolAllowableValues[i] = new AllowableValue(memoryPoolBeans.get(i).getName());
    +        }
    +    }
    +
         public static final PropertyDescriptor MEMORY_POOL_PROPERTY = new PropertyDescriptor.Builder()
                 .name("Memory Pool")
                 .description("The name of the JVM Memory Pool to monitor")
    --- End diff --
    
    One thing you and I always agreed on, so yeah, why not?


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