azagrebin commented on a change in pull request #8191: [FLINK-12213][network]
Pass TaskManagerMetricGroup into constructor of NetworkEnvironment
URL: https://github.com/apache/flink/pull/8191#discussion_r276285846
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/NetworkEnvironment.java
##########
@@ -63,11 +70,19 @@
private boolean isShutdown;
- public NetworkEnvironment(NetworkEnvironmentConfiguration config,
TaskEventPublisher taskEventPublisher) {
+ public NetworkEnvironment(
+ NetworkEnvironmentConfiguration config,
+ TaskEventPublisher taskEventPublisher,
+ TaskManagerMetricGroup taskManagerMetricGroup) {
this.config = checkNotNull(config);
this.networkBufferPool = new
NetworkBufferPool(config.numNetworkBuffers(), config.networkBufferSize());
+ checkNotNull(taskManagerMetricGroup);
Review comment:
private static registerNetworkMetrics(ComponentMetricGroup
parentMetricGroup) {
checkNotNull(parentMetricGroup);
MetricGroup networkGroup =
parentMetricGroup.addGroup(METRIC_GROUP_NETWORK);
networkGroup.<Integer, Gauge<Integer>>gauge(METRIC_TOTAL_MEMORY_SEGMENT,
networkBufferPool::getTotalNumberOfMemorySegments);
networkGroup.<Integer,
Gauge<Integer>>gauge(METRIC_AVAILABLE_MEMORY_SEGMENT,
networkBufferPool::getNumberOfAvailableMemorySegments);
}
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services