You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/26 08:32:19 UTC

[GitHub] [flink] jinglining opened a new pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

jinglining opened a new pull request #11913:
URL: https://github.com/apache/flink/pull/11913


   ## What is the purpose of the change
   This pull request makes JobDetailsHandler to show metrics of network pool usage and back-pressured.
   ## Brief change log
   - pool usage: outPoolUsageAvg, inputExclusiveBuffersUsageAvg, inputFloatingBuffersUsageAvg
   - back-pressured for show whether it is back pressured(merge all iths subtasks)
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   - JobDetailsInfoTest
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not documented)
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] hejianchao commented on a change in pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
hejianchao commented on a change in pull request #11913:
URL: https://github.com/apache/flink/pull/11913#discussion_r415595824



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/metrics/JobVertexIOMetricsInfo.java
##########
@@ -0,0 +1,178 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.rest.messages.job.metrics;
+
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
+import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.Objects;
+
+/**
+ * JobVertex IO metrics information.
+ */
+public final class JobVertexIOMetricsInfo extends IOMetricsInfo {
+
+	private static final String FIELD_NAME_INPUT_EXCLUSIVE_BUFFERS_USAGE_AVG = "input-exclusive-buffers-usage-avg";
+
+	private static final String FIELD_NAME_INPUT_EXCLUSIVE_BUFFERS_USAGE_AVG_COMPLETE = "input-exclusive-buffers-usage-avg-complete";
+
+	private static final String FIELD_NAME_INPUT_FLOATING_BUFFERS_AVG_USAGE = "input-floating-buffers-usage-avg";
+
+	private static final String FIELD_NAME_INPUT_FLOATING_BUFFERS_USAGE_AVG_COMPLETE = "input-floating-buffers-usage-avg-complete";
+
+	private static final String FIELD_NAME_OUT_POOL_USAGE_AVG = "out-pool-usage-avg";
+
+	private static final String FIELD_NAME_OUT_POOL_USAGE_AVG_COMPLETE = "out-pool-usage-avg-complete";
+
+	private static final String FIELD_NAME_IS_BACKPRESSED = "is-backpressed";
+
+	private static final String FIELD_NAME_IS_BACKPRESSED_COMPLETE = "is-backpressed-complete";
+
+	@JsonProperty(FIELD_NAME_INPUT_EXCLUSIVE_BUFFERS_USAGE_AVG)
+	private final float inputExclusiveBuffersUsageAvg;
+
+	@JsonProperty(FIELD_NAME_INPUT_EXCLUSIVE_BUFFERS_USAGE_AVG_COMPLETE)
+	private final boolean inputExclusiveBuffersUsageAvgComplete;
+
+	@JsonProperty(FIELD_NAME_INPUT_FLOATING_BUFFERS_AVG_USAGE)
+	private final float inputFloatingBuffersUsageAvg;
+
+	@JsonProperty(FIELD_NAME_INPUT_FLOATING_BUFFERS_USAGE_AVG_COMPLETE)
+	private final boolean inputFloatingBuffersUsageAvgComplete;
+
+	@JsonProperty(FIELD_NAME_OUT_POOL_USAGE_AVG)
+	private final float outPoolUsageAvg;
+
+	@JsonProperty(FIELD_NAME_OUT_POOL_USAGE_AVG_COMPLETE)
+	private final boolean outPoolUsageAvgComplete;
+
+	@JsonProperty(FIELD_NAME_IS_BACKPRESSED)
+	private final boolean isBackPressured;
+
+	@JsonProperty(FIELD_NAME_IS_BACKPRESSED_COMPLETE)
+	private final boolean isBackPressuredComplete;
+
+	@JsonCreator
+	public JobVertexIOMetricsInfo(
+		@JsonProperty(FIELD_NAME_BYTES_READ) long bytesRead,
+		@JsonProperty(FIELD_NAME_BYTES_READ_COMPLETE) boolean bytesReadComplete,
+		@JsonProperty(FIELD_NAME_BYTES_WRITTEN) long bytesWritten,
+		@JsonProperty(FIELD_NAME_BYTES_WRITTEN_COMPLETE) boolean bytesWrittenComplete,
+		@JsonProperty(FIELD_NAME_RECORDS_READ) long recordsRead,
+		@JsonProperty(FIELD_NAME_RECORDS_READ_COMPLETE) boolean recordsReadComplete,
+		@JsonProperty(FIELD_NAME_RECORDS_WRITTEN) long recordsWritten,
+		@JsonProperty(FIELD_NAME_RECORDS_WRITTEN_COMPLETE) boolean recordsWrittenComplete,
+		@JsonProperty(FIELD_NAME_INPUT_EXCLUSIVE_BUFFERS_USAGE_AVG) float inputExclusiveBuffersUsageAvg,
+		@JsonProperty(FIELD_NAME_INPUT_EXCLUSIVE_BUFFERS_USAGE_AVG_COMPLETE) boolean inputExclusiveBuffersUsageAvgComplete,
+		@JsonProperty(FIELD_NAME_INPUT_FLOATING_BUFFERS_AVG_USAGE) float inputFloatingBuffersUsageAvg,
+		@JsonProperty(FIELD_NAME_INPUT_FLOATING_BUFFERS_USAGE_AVG_COMPLETE) boolean inputFloatingBuffersUsageAvgComplete,
+		@JsonProperty(FIELD_NAME_OUT_POOL_USAGE_AVG) float outPoolUsageAvg,
+		@JsonProperty(FIELD_NAME_OUT_POOL_USAGE_AVG_COMPLETE) boolean outPoolUsageAvgComplete,
+		@JsonProperty(FIELD_NAME_IS_BACKPRESSED) boolean isBackPressured,
+		@JsonProperty(FIELD_NAME_IS_BACKPRESSED_COMPLETE) boolean isBackPressuredComplete) {
+		super(bytesRead, bytesReadComplete, bytesWritten, bytesWrittenComplete, recordsRead, recordsReadComplete,
+			recordsWritten, recordsWrittenComplete);
+		this.outPoolUsageAvg = outPoolUsageAvg;
+		this.outPoolUsageAvgComplete = outPoolUsageAvgComplete;
+		this.inputExclusiveBuffersUsageAvg = inputExclusiveBuffersUsageAvg;
+		this.inputExclusiveBuffersUsageAvgComplete = inputExclusiveBuffersUsageAvgComplete;
+		this.inputFloatingBuffersUsageAvg = inputFloatingBuffersUsageAvg;
+		this.inputFloatingBuffersUsageAvgComplete = inputFloatingBuffersUsageAvgComplete;
+		this.isBackPressured = isBackPressured;
+		this.isBackPressuredComplete = isBackPressuredComplete;
+	}
+
+	@JsonIgnore
+	public float getInputExclusiveBuffersUsageAvg() {
+		return inputExclusiveBuffersUsageAvg;
+	}
+
+	@JsonIgnore
+	public boolean isInputExclusiveBuffersUsageAvgComplete() {
+		return inputExclusiveBuffersUsageAvgComplete;
+	}
+
+	@JsonIgnore
+	public float getInputFloatingBuffersUsageAvg() {
+		return inputFloatingBuffersUsageAvg;
+	}
+
+	@JsonIgnore
+	public boolean isInputFloatingBuffersUsageAvgComplete() {
+		return inputFloatingBuffersUsageAvgComplete;
+	}
+
+	@JsonIgnore
+	public float getOutPoolUsageAvg() {
+		return outPoolUsageAvg;
+	}
+
+	@JsonIgnore
+	public boolean isOutPoolUsageAvgComplete() {
+		return outPoolUsageAvgComplete;
+	}
+
+	@JsonIgnore
+	public boolean isBackPressured() {
+		return isBackPressured;
+	}
+
+	@JsonIgnore
+	public boolean isBackPressuredComplete() {
+		return isBackPressuredComplete;
+	}
+
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) {
+			return true;
+		}
+		if (o == null || getClass() != o.getClass()) {
+			return false;
+		}
+		JobVertexIOMetricsInfo that = (JobVertexIOMetricsInfo) o;
+		return this.getBytesRead() == that.getBytesRead() &&
+			this.isBytesReadComplete() == that.isBytesReadComplete() &&
+			this.getBytesWritten() == that.getBytesWritten() &&
+			this.isBytesWrittenComplete() == that.isBytesWrittenComplete() &&
+			this.getRecordsRead() == that.getRecordsRead() &&
+			this.isRecordsReadComplete() == that.isRecordsReadComplete() &&
+			this.getRecordsWritten() == that.getRecordsWritten() &&
+			this.isRecordsWrittenComplete() == that.isRecordsWrittenComplete() &&
+			this.getInputExclusiveBuffersUsageAvg() == that.getInputExclusiveBuffersUsageAvg() &&
+			this.isInputExclusiveBuffersUsageAvgComplete() == that.isInputExclusiveBuffersUsageAvgComplete() &&
+			this.getInputFloatingBuffersUsageAvg() == that.getInputFloatingBuffersUsageAvg() &&
+			this.isInputFloatingBuffersUsageAvgComplete() == that.isInputFloatingBuffersUsageAvgComplete() &&
+			this.getOutPoolUsageAvg() == that.getOutPoolUsageAvg() &&
+			this.isOutPoolUsageAvgComplete() == that.isOutPoolUsageAvgComplete() &&
+			this.isBackPressured() == that.isBackPressured() &&
+			this.isBackPressuredComplete() == that.isBackPressuredComplete();
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.getBytesRead(), this.isBytesReadComplete(), this.getBytesWritten(), this.isBytesWrittenComplete(),

Review comment:
       How about one field each line?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0cef23af2d70919208cb3dc5479efc3b99cc32c Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162051334) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262) 
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * 3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162157216) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162700272",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * a613eea5e61e3374a1a61dd3ae8385b2e3821994 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162700272) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * 3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162157216) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] hejianchao commented on a change in pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
hejianchao commented on a change in pull request #11913:
URL: https://github.com/apache/flink/pull/11913#discussion_r415593198



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/MutableIOMetrics.java
##########
@@ -96,41 +122,67 @@ public void addIOMetrics(AccessExecution attempt, @Nullable MetricFetcher fetche
 					 * In case a metric is missing for a parallel instance of a task, we set the complete flag as
 					 * false.
 					 */
-					if (metrics.getMetric(MetricNames.IO_NUM_BYTES_IN) == null){
-						this.numBytesInComplete = false;
-					}
-					else {
-						this.numBytesIn += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_BYTES_IN));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_BYTES_OUT) == null){
-						this.numBytesOutComplete = false;
-					}
-					else {
-						this.numBytesOut += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_BYTES_OUT));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_RECORDS_IN) == null){
-						this.numRecordsInComplete = false;
-					}
-					else {
-						this.numRecordsIn += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_RECORDS_IN));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_RECORDS_OUT) == null){
-						this.numRecordsOutComplete = false;
-					}
-					else {
-						this.numRecordsOut += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_RECORDS_OUT));
-					}
+					update(metrics, MetricNames.IO_NUM_BYTES_IN,
+						(String value) -> this.numBytesInComplete = false,
+						(String value) -> this.numBytesIn += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_BYTES_OUT,
+						(String value) -> this.numBytesOutComplete = false,
+						(String value) -> this.numBytesOut += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_RECORDS_IN,
+						(String value) -> this.numRecordsInComplete = false,
+						(String value) -> this.numRecordsIn += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_RECORDS_OUT,
+						(String value) -> this.numRecordsOutComplete = false,
+						(String value) -> this.numRecordsOut += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_INPUT_FLOATING_BUFFERS,
+						(String value) -> this.usageInputFloatingBuffersComplete = false,
+						(String value) -> this.usageInputFloatingBuffers += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_INPUT_EXCLUSIVE_BUFFERS,
+						(String value) -> this.usageInputExclusiveBuffersComplete = false,
+						(String value) -> this.usageInputExclusiveBuffers += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_OUTPUT_POOL_USAGE,
+						(String value) -> this.usageOutPoolComplete = false,
+						(String value) -> this.usageOutPool += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IS_BACKPRESSURED,
+						(String value) -> this.isBackPressuredComplete = false,
+						(String value) -> this.isBackPressured |= Boolean.valueOf(value)
+					);
 				}
 				else {
 					this.numBytesInComplete = false;
 					this.numBytesOutComplete = false;
 					this.numRecordsInComplete = false;
 					this.numRecordsOutComplete = false;
+					this.usageInputFloatingBuffersComplete = false;
+					this.usageInputExclusiveBuffersComplete = false;
+					this.usageOutPoolComplete = false;
+					this.isBackPressuredComplete = false;
 				}
 			}
 		}
 	}
+
+	private void update(MetricStore.ComponentMetricStore metrics, String metricKey, Consumer<String> emptyFunction, Consumer<String> noEmptyFunction) {

Review comment:
       The introduction of this method is a good refactoring.
   
   Better to change to multiple lines.
   Maybe rename `noEmptyFunction` to `nonEmptyFunction`?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619509739


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit a0cef23af2d70919208cb3dc5479efc3b99cc32c (Sun Apr 26 08:34:41 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] hejianchao commented on a change in pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
hejianchao commented on a change in pull request #11913:
URL: https://github.com/apache/flink/pull/11913#discussion_r415591255



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricNames.java
##########
@@ -49,6 +54,27 @@ private MetricNames() {
 	public static final String IO_CURRENT_INPUT_WATERMARK_PATERN = "currentInput%dWatermark";
 	public static final String IO_CURRENT_OUTPUT_WATERMARK = "currentOutputWatermark";
 
+	private static final String  SHUFFLE_NETTY_GROUP = new StringJoiner(OperatorScopeFormat.SCOPE_SEPARATOR)

Review comment:
       Suggested to simplify it by writing this way: `java.lang.String#join(java.lang.CharSequence, java.lang.CharSequence...)`




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162700272",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * 3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162157216) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287) 
   * a613eea5e61e3374a1a61dd3ae8385b2e3821994 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162700272) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0cef23af2d70919208cb3dc5479efc3b99cc32c Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162051334) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262) 
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * 3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162157216) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287) 
   * a613eea5e61e3374a1a61dd3ae8385b2e3821994 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162700272",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a613eea5e61e3374a1a61dd3ae8385b2e3821994 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162700272) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0cef23af2d70919208cb3dc5479efc3b99cc32c Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162051334) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] hejianchao commented on a change in pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
hejianchao commented on a change in pull request #11913:
URL: https://github.com/apache/flink/pull/11913#discussion_r415593198



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/MutableIOMetrics.java
##########
@@ -96,41 +122,67 @@ public void addIOMetrics(AccessExecution attempt, @Nullable MetricFetcher fetche
 					 * In case a metric is missing for a parallel instance of a task, we set the complete flag as
 					 * false.
 					 */
-					if (metrics.getMetric(MetricNames.IO_NUM_BYTES_IN) == null){
-						this.numBytesInComplete = false;
-					}
-					else {
-						this.numBytesIn += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_BYTES_IN));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_BYTES_OUT) == null){
-						this.numBytesOutComplete = false;
-					}
-					else {
-						this.numBytesOut += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_BYTES_OUT));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_RECORDS_IN) == null){
-						this.numRecordsInComplete = false;
-					}
-					else {
-						this.numRecordsIn += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_RECORDS_IN));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_RECORDS_OUT) == null){
-						this.numRecordsOutComplete = false;
-					}
-					else {
-						this.numRecordsOut += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_RECORDS_OUT));
-					}
+					update(metrics, MetricNames.IO_NUM_BYTES_IN,
+						(String value) -> this.numBytesInComplete = false,
+						(String value) -> this.numBytesIn += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_BYTES_OUT,
+						(String value) -> this.numBytesOutComplete = false,
+						(String value) -> this.numBytesOut += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_RECORDS_IN,
+						(String value) -> this.numRecordsInComplete = false,
+						(String value) -> this.numRecordsIn += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_RECORDS_OUT,
+						(String value) -> this.numRecordsOutComplete = false,
+						(String value) -> this.numRecordsOut += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_INPUT_FLOATING_BUFFERS,
+						(String value) -> this.usageInputFloatingBuffersComplete = false,
+						(String value) -> this.usageInputFloatingBuffers += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_INPUT_EXCLUSIVE_BUFFERS,
+						(String value) -> this.usageInputExclusiveBuffersComplete = false,
+						(String value) -> this.usageInputExclusiveBuffers += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_OUTPUT_POOL_USAGE,
+						(String value) -> this.usageOutPoolComplete = false,
+						(String value) -> this.usageOutPool += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IS_BACKPRESSURED,
+						(String value) -> this.isBackPressuredComplete = false,
+						(String value) -> this.isBackPressured |= Boolean.valueOf(value)
+					);
 				}
 				else {
 					this.numBytesInComplete = false;
 					this.numBytesOutComplete = false;
 					this.numRecordsInComplete = false;
 					this.numRecordsOutComplete = false;
+					this.usageInputFloatingBuffersComplete = false;
+					this.usageInputExclusiveBuffersComplete = false;
+					this.usageOutPoolComplete = false;
+					this.isBackPressuredComplete = false;
 				}
 			}
 		}
 	}
+
+	private void update(MetricStore.ComponentMetricStore metrics, String metricKey, Consumer<String> emptyFunction, Consumer<String> noEmptyFunction) {

Review comment:
       The introduction of this method is a good refactoring, 👍.
   
   Better to change to multiple lines.
   Maybe rename `noEmptyFunction` to `nonEmptyFunction`?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * 3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162157216) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0cef23af2d70919208cb3dc5479efc3b99cc32c Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162051334) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262) 
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a0cef23af2d70919208cb3dc5479efc3b99cc32c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] hejianchao commented on a change in pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
hejianchao commented on a change in pull request #11913:
URL: https://github.com/apache/flink/pull/11913#discussion_r415591255



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricNames.java
##########
@@ -49,6 +54,27 @@ private MetricNames() {
 	public static final String IO_CURRENT_INPUT_WATERMARK_PATERN = "currentInput%dWatermark";
 	public static final String IO_CURRENT_OUTPUT_WATERMARK = "currentOutputWatermark";
 
+	private static final String  SHUFFLE_NETTY_GROUP = new StringJoiner(OperatorScopeFormat.SCOPE_SEPARATOR)

Review comment:
       Suggested to simplify it by writing this way: `java.lang.String#join(java.lang.CharSequence, java.lang.CharSequence...)`, It's the same below.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] hejianchao commented on a change in pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
hejianchao commented on a change in pull request #11913:
URL: https://github.com/apache/flink/pull/11913#discussion_r415593198



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/util/MutableIOMetrics.java
##########
@@ -96,41 +122,67 @@ public void addIOMetrics(AccessExecution attempt, @Nullable MetricFetcher fetche
 					 * In case a metric is missing for a parallel instance of a task, we set the complete flag as
 					 * false.
 					 */
-					if (metrics.getMetric(MetricNames.IO_NUM_BYTES_IN) == null){
-						this.numBytesInComplete = false;
-					}
-					else {
-						this.numBytesIn += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_BYTES_IN));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_BYTES_OUT) == null){
-						this.numBytesOutComplete = false;
-					}
-					else {
-						this.numBytesOut += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_BYTES_OUT));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_RECORDS_IN) == null){
-						this.numRecordsInComplete = false;
-					}
-					else {
-						this.numRecordsIn += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_RECORDS_IN));
-					}
-
-					if (metrics.getMetric(MetricNames.IO_NUM_RECORDS_OUT) == null){
-						this.numRecordsOutComplete = false;
-					}
-					else {
-						this.numRecordsOut += Long.valueOf(metrics.getMetric(MetricNames.IO_NUM_RECORDS_OUT));
-					}
+					update(metrics, MetricNames.IO_NUM_BYTES_IN,
+						(String value) -> this.numBytesInComplete = false,
+						(String value) -> this.numBytesIn += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_BYTES_OUT,
+						(String value) -> this.numBytesOutComplete = false,
+						(String value) -> this.numBytesOut += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_RECORDS_IN,
+						(String value) -> this.numRecordsInComplete = false,
+						(String value) -> this.numRecordsIn += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IO_NUM_RECORDS_OUT,
+						(String value) -> this.numRecordsOutComplete = false,
+						(String value) -> this.numRecordsOut += Long.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_INPUT_FLOATING_BUFFERS,
+						(String value) -> this.usageInputFloatingBuffersComplete = false,
+						(String value) -> this.usageInputFloatingBuffers += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_INPUT_EXCLUSIVE_BUFFERS,
+						(String value) -> this.usageInputExclusiveBuffersComplete = false,
+						(String value) -> this.usageInputExclusiveBuffers += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.USAGE_SHUFFLE_NETTY_OUTPUT_POOL_USAGE,
+						(String value) -> this.usageOutPoolComplete = false,
+						(String value) -> this.usageOutPool += Float.valueOf(value)
+					);
+
+					update(metrics, MetricNames.IS_BACKPRESSURED,
+						(String value) -> this.isBackPressuredComplete = false,
+						(String value) -> this.isBackPressured |= Boolean.valueOf(value)
+					);
 				}
 				else {
 					this.numBytesInComplete = false;
 					this.numBytesOutComplete = false;
 					this.numRecordsInComplete = false;
 					this.numRecordsOutComplete = false;
+					this.usageInputFloatingBuffersComplete = false;
+					this.usageInputExclusiveBuffersComplete = false;
+					this.usageOutPoolComplete = false;
+					this.isBackPressuredComplete = false;
 				}
 			}
 		}
 	}
+
+	private void update(MetricStore.ComponentMetricStore metrics, String metricKey, Consumer<String> emptyFunction, Consumer<String> noEmptyFunction) {

Review comment:
       Better to change to multiple lines.
   Maybe rename `noEmptyFunction` to `nonEmptyFunction`?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 2a157fb18621c504eb5f97bb5d6ae7dbd5605811 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162060286) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266) 
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * 3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] pnowojski closed pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
pnowojski closed pull request #11913:
URL: https://github.com/apache/flink/pull/11913


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11913: [FLINK-17328][rest]Expose network metric for job vertex in rest api

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11913:
URL: https://github.com/apache/flink/pull/11913#issuecomment-619511945


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162051334",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=262",
       "triggerID" : "a0cef23af2d70919208cb3dc5479efc3b99cc32c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=266",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162060286",
       "triggerID" : "2a157fb18621c504eb5f97bb5d6ae7dbd5605811",
       "triggerType" : "PUSH"
     }, {
       "hash" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162157216",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=287",
       "triggerID" : "3a504cf4cfb4ac0bc2d71b7a8d37ebe440cc84d5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162700272",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419",
       "triggerID" : "a613eea5e61e3374a1a61dd3ae8385b2e3821994",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0c722f3e3cb9e4c5b6e173b46e4c6c53429c7bdc UNKNOWN
   * a613eea5e61e3374a1a61dd3ae8385b2e3821994 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162700272) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=419) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org