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

    https://github.com/apache/flink/pull/2727#discussion_r85869851
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/groups/TaskIOMetricGroup.java
 ---
    @@ -80,18 +76,25 @@ public Meter getNumBytesOutRateMeter() {
                return numBytesOutRate;
        }
     
    -   public MetricGroup getBuffersGroup() {
    -           return buffers;
    -   }
    -
        // 
------------------------------------------------------------------------
        //  metrics of Buffers group
        // 
------------------------------------------------------------------------
     
        /**
    +    * initialize Buffer Metrics for a task
    +    */
    +   public void initializeBufferMetrics(Task task) {
    +           final MetricGroup buffers = addGroup("buffers");
    +           buffers.gauge("inputQueueLength", new InputBuffersGauge(task));
    +           buffers.gauge("outputQueueLength", new 
OutputBuffersGauge(task));
    +           buffers.gauge("inPoolUsage", new 
InputBufferPoolUsageGauge(task));
    +           buffers.gauge("outPoolUsage", new 
OutputBufferPoolUsageGauge(task));
    +   }
    +
    +   /**
         * Input received buffers gauge of a task
         */
    -   public static final class InputBuffersGauge implements Gauge<Integer> {
    +   private final class InputBuffersGauge implements Gauge<Integer> {
    --- End diff --
    
    InputBuffersGauge is unaccessible for any class except TaskIOMetricGroup, 
so I change the public to private. It can work no matter whether it is static 
or not. to save outclass reference, static is prefer.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to