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 2022/03/14 10:32:03 UTC

[GitHub] [flink] AHeise commented on a change in pull request #19060: [FLINK-26532][metrics][test] using the numRecordsSend counter to get the correct metric

AHeise commented on a change in pull request #19060:
URL: https://github.com/apache/flink/pull/19060#discussion_r825800063



##########
File path: flink-tests/src/test/java/org/apache/flink/test/streaming/runtime/SinkMetricsITCase.java
##########
@@ -130,8 +132,10 @@ private void assertSinkMetrics(
         int subtaskWithMetrics = 0;
         for (OperatorMetricGroup group : groups) {
             Map<String, Metric> metrics = reporter.getMetricsByGroup(group);
-            // there are only 2 splits assigned; so two groups will not update metrics
-            if (group.getIOMetricGroup().getNumRecordsOutCounter().getCount() != 0) {
+            // There are only 2 splits assigned; so two groups will not update metrics.
+            // There is no other way to access the counter via OperatorMetricGroup, we have to use
+            // metrics from the reporter.
+            if (((Counter) metrics.get(MetricNames.NUM_RECORDS_SEND)).getCount() == 0) {

Review comment:
       You actually made it consistent.




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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org