1996fanrui commented on code in PR #743:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/743#discussion_r1441197747
##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/metrics/ScalingMetrics.java:
##########
@@ -216,15 +216,23 @@ private static double getNumRecordsInPerSecond(
Map<FlinkMetric, AggregatedMetric> flinkMetrics,
JobVertexID jobVertexID,
boolean isSource) {
+ // Generate numRecordsInPerSecond from 3 metrics:
+ // 1. If available, directly use the NUM_RECORDS_IN_PER_SEC task
metric.
var numRecordsInPerSecond =
flinkMetrics.get(FlinkMetric.NUM_RECORDS_IN_PER_SEC);
+ // 2. If the former is unavailable and the vertex contains a source
operator, use the
+ // corresponding source operator metric.
if (isSource && (numRecordsInPerSecond == null ||
numRecordsInPerSecond.getSum() == 0)) {
numRecordsInPerSecond =
flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_IN_PER_SEC);
}
+ // 3. If the vertex contains a source operator which does not emit
input metrics, use output
+ // metrics instead.
+ // then use SOURCE_TASK_NUM_RECORDS_OUT_PER_SEC metric
Review Comment:
```suggestion
```
Is this leftover?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]