zhijiangW commented on a change in pull request #8320: 
[FLINK-12201][network,metrics] Introduce InputGateWithMetrics in Task to 
increment numBytesIn metric
URL: https://github.com/apache/flink/pull/8320#discussion_r290178064
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/benchmark/StreamNetworkBenchmarkEnvironment.java
 ##########
 @@ -270,4 +266,18 @@ private InputGateDeploymentDescriptor 
createInputGateDeploymentDescriptor(
                        consumedSubpartitionIndex,
                        channelDescriptors);
        }
+
+       private InputGate createInputGateWithMetrics(
+               SingleInputGateFactory gateFactory,
+               InputGateDeploymentDescriptor gateDescriptor,
+               int channelIndex) {
+
+               final SingleInputGate singleGate = gateFactory.create(
+                       "receiving task[" + channelIndex + "]",
+                       gateDescriptor,
+                       SingleInputGateBuilder.NO_OP_PRODUCER_CHECKER,
+                       
InputChannelTestUtils.newUnregisteredInputChannelMetrics());
+
+               return new InputGateWithMetrics(singleGate, new 
SimpleCounter());
 
 Review comment:
   I could understand your concern here. 
   ATM the `InputGateWithMetrics` is only created in the benchmark which would 
reflect the real process. Considering this wrapper is very easy to construct 
and the duplication here is not obvious, just a local `singleGate` definition, 
I think we could introduce another factory for this wrapped `InputGate` if 
necessary later?
    

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