Github user rmetzger commented on a diff in the pull request: https://github.com/apache/flink/pull/2616#discussion_r84697528 --- Diff: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JobVertexDetailsHandler.java --- @@ -99,11 +83,34 @@ public String handleRequest(ExecutionJobVertex jobVertex, Map<String, String> pa gen.writeNumberField("end-time", endTime); gen.writeNumberField("duration", duration); + IOMetrics ioMetrics = vertex.getCurrentExecutionAttempt().getIOMetrics(); + + long numBytesIn = 0; + long numBytesOut = 0; + long numRecordsIn = 0; + long numRecordsOut = 0; + + if (ioMetrics != null) { // execAttempt is already finished, use final metrics stored in ExecutionGraph + numBytesIn = ioMetrics.getNumBytesInLocal() + ioMetrics.getNumBytesInRemote(); + numBytesOut = ioMetrics.getNumBytesOut(); + numRecordsIn = ioMetrics.getNumRecordsIn(); + numRecordsOut = ioMetrics.getNumRecordsOut(); + } else { // execAttempt is still running, use MetricQueryService instead + fetcher.update(); + MetricStore.SubtaskMetricStore metrics = fetcher.getMetricStore().getSubtaskMetricStore(vertex.getJobId().toString(), vertex.getJobvertexId().toString(), vertex.getParallelSubtaskIndex()); + if (metrics != null) { + numBytesIn += Long.valueOf(metrics.getMetric("numBytesInLocal", "0")) + Long.valueOf(metrics.getMetric("numBytesInRemote", "0")); + numBytesOut += Long.valueOf(metrics.getMetric("numBytesOut", "0")); + numRecordsIn += Long.valueOf(metrics.getMetric("numRecordsIn", "0")); + numRecordsOut += Long.valueOf(metrics.getMetric("numRecordsOut", "0")); --- End diff -- The metric names are used in many places. I think we should use constants for them.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---