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

    https://github.com/apache/storm/pull/2504#discussion_r162505874
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/daemon/supervisor/Container.java ---
    @@ -693,4 +701,44 @@ public long getMemoryReservationMb() {
         public String getWorkerId() {
             return _workerId;
         }
    +
    +    /**
    +     * Send worker metrics to Nimbus.
    +     */
    +    void processMetrics() {
    +        try {
    +            if (_usedMemory.get(_port) != null) {
    +                // Make sure we don't process too frequently.
    +                long nextMetricProcessTime = this.lastMetricProcessTime + 
60L * 1000L;
    +                long currentTimeMsec = System.currentTimeMillis();
    +                if (currentTimeMsec < nextMetricProcessTime) {
    +                    return;
    +                }
    +
    +                String hostname = Utils.hostname();
    +
    +                // create metric for memory
    +                String metricName = "UsedMemory";
    --- End diff --
    
    minor: maybe better to have constants for strings here, since they're 
likely to be reused while retrieving information.


---

Reply via email to