Github user Ethanlm commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2764#discussion_r208987159
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java ---
    @@ -4729,4 +4760,192 @@ public IScheduler getForcedScheduler() {
     
         }
     
    +    //enum NotPorted {
    +    //    //Declared in StormConf. I don't see the value in reporting so.
    +    //    SUPERVISOR_TOTAL_RESOURCE,
    +    //    //May be able to aggregate based on status;
    +    //    TOPOLOGY_STATUS,
    +    //    TOPOLOGY_SCHED_STATUS,
    +    //    //May be aggregated, as well as other distinct values
    +    //    NUM_DISTINCT_NIMBUS_VERSION;
    +    //}
    +
    +    private class ClusterSummaryMetricSet implements MetricSet, Runnable {
    +        static final int CACHING_WINDOW = 5;
    +        static final int PORTED_METRICS = 25;
    +        static final String SUMMARY = "summary";
    +
    +        private final Map<String, com.codahale.metrics.Metric> ported = 
new HashMap<>(PORTED_METRICS);
    +        private final Function<String, Histogram> registerHistogram = 
(name) -> {
    +            final Histogram histogram = new Histogram(new 
SlidingTimeWindowReservoir(CACHING_WINDOW / 2, TimeUnit.SECONDS));
    +            ported.put(name, histogram);
    +            return histogram;
    +        };
    +        private volatile boolean active = false;
    +
    +        //NImbus metrics distribution
    +        private final Histogram nimbusUptime = 
registerHistogram.apply("nimbuses:uptime-secs");
    +
    +        //Supervisor metrics distribution
    +        private final Histogram supervisorsUptime = 
registerHistogram.apply("supervisors:uptime-secs");
    +        private final Histogram supervisorsNumWorkers = 
registerHistogram.apply("supervisors:num-workers");
    +        private final Histogram supervisorsNumUsedWorkers = 
registerHistogram.apply("supervisors:num-used-workers");
    +        private final Histogram supervisorsUsedMem = 
registerHistogram.apply("supervisors:used-mem");
    +        private final Histogram supervisorsUsedCpu = 
registerHistogram.apply("supervisors:used-CPU");
    --- End diff --
    
    use lowercase for "CPU" to be consistent with other names?


---

Reply via email to