zhijiangW commented on a change in pull request #8485: [FLINK-12555] Introduce 
an encapsulated metric group layout for shuffle API
URL: https://github.com/apache/flink/pull/8485#discussion_r291012064
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java
 ##########
 @@ -280,6 +294,31 @@ private void registerInputMetrics(MetricGroup inputGroup, 
MetricGroup buffersGro
                buffersGroup.gauge(METRIC_INPUT_POOL_USAGE, new 
InputBufferPoolUsageGauge(inputGates));
        }
 
+       /**
+        * Registers legacy network metric groups before shuffle service 
refactoring.
+        *
+        * <p>Registers legacy metric groups if shuffle service implementation 
is original default one.
+        *
+        * @deprecated should be removed in future
+        */
+       @SuppressWarnings("DeprecatedIsStillUsed")
+       @Deprecated
+       public void registerLegacyNetworkMetrics(
+               MetricGroup metricGroup,
+               ResultPartitionWriter[] producedPartitions,
+               InputGate[] inputGates) {
+               // add metrics for buffers
+               final MetricGroup buffersGroup = 
metricGroup.addGroup("buffers");
+
+               // similar to MetricUtils.instantiateNetworkMetrics() but 
inside this IOMetricGroup
+               final MetricGroup networkGroup = 
metricGroup.addGroup("Network");
+               final MetricGroup outputGroup = networkGroup.addGroup("Output");
+               final MetricGroup inputGroup = networkGroup.addGroup("Input");
 
 Review comment:
   Use `METRIC_GROUP_OUTPUT` and `METRIC_GROUP_INPUT` instead of `Output` and 
`Input`, also might define a class var for `Network`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to