1996fanrui commented on code in PR #743:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/743#discussion_r1440104568
##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/metrics/ScalingMetrics.java:
##########
@@ -221,7 +221,7 @@ private static double getNumRecordsInPerSecond(
numRecordsInPerSecond =
flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_IN_PER_SEC);
}
- if (isSource && (numRecordsInPerSecond == null ||
numRecordsInPerSecond.getSum() == 0)) {
+ if (!isSource && (numRecordsInPerSecond == null ||
numRecordsInPerSecond.getSum() == 0)) {
numRecordsInPerSecond =
flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_OUT_PER_SEC);
}
Review Comment:
Thanks @Yang-LI-CS for the PR!
These 2 conditions are indeed the same, it maybe unexpected intuitively.
Maybe here logic is numRecordsInPerSecond from 3 metrics:
1. FlinkMetric.NUM_RECORDS_IN_PER_SEC
2. FlinkMetric.SOURCE_TASK_NUM_RECORDS_IN_PER_SEC
3. FlinkMetric.SOURCE_TASK_NUM_RECORDS_OUT_PER_SEC
When 1 is unavailable, get it from 2. When 2 is unavailable, get it from 3.
I'm not sure about it. Need to confirm with @mxm .
- If my guess is right, it's not a bug. And I suggest this PR add a little
comments to clarify it.
- If my guess is wrong, it's a bug. We can fix it.
WDYT?
--
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]