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_r288627127
########## File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/io/benchmark/StreamNetworkBenchmarkEnvironment.java ########## @@ -249,18 +250,21 @@ private InputGate createInputGate( channel, channelDescriptors); - SingleInputGate gate = new SingleInputGateFactory( + final SingleInputGateFactory gateFactory = new SingleInputGateFactory( environment.getConfiguration(), environment.getConnectionManager(), environment.getResultPartitionManager(), new TaskEventDispatcher(), - environment.getNetworkBufferPool()) - .create( + environment.getNetworkBufferPool()); + + final InputGate gate = new InputGateWithMetrics( + gateFactory.create( Review comment: Actually gate factory should not be created inside loop, and it could be created only once together with `NetworkEnvironment`. I would submit a hotfix commit firstly for refactoring this method, and then append my PR based on it. ---------------------------------------------------------------- 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