[
https://issues.apache.org/jira/browse/FLINK-33966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rui Fan resolved FLINK-33966.
-----------------------------
Fix Version/s: kubernetes-operator-1.8.0
Resolution: Fixed
> Fix the getNumRecordsInPerSecond Utility Function
> -------------------------------------------------
>
> Key: FLINK-33966
> URL: https://issues.apache.org/jira/browse/FLINK-33966
> Project: Flink
> Issue Type: Bug
> Components: Autoscaler
> Affects Versions: kubernetes-operator-1.7.0
> Reporter: Yang LI
> Assignee: Yang LI
> Priority: Minor
> Labels: pull-request-available
> Fix For: kubernetes-operator-1.8.0
>
>
> We have following code in the codebase
> {code:java}
> if (isSource && (numRecordsInPerSecond == null ||
> numRecordsInPerSecond.getSum() == 0)) {
> numRecordsInPerSecond =
>
> flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_IN_PER_SEC);
> }{code}
> {code:java}
> if (isSource && (numRecordsInPerSecond == null ||
> numRecordsInPerSecond.getSum() == 0)) {
> numRecordsInPerSecond =
>
> flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_OUT_PER_SEC);
> }{code}
> with two times the same condition check
>
> {*}Definition of done{*}:
> Update getNumRecordsInPerSecond'{{{}s{}}} second {{if}} condition from {{if
> (isSource && ...)}} to {{{}if (!isSource && ...){}}}. This addresses the
> redundant check and ensures correct metric fetching for non-source operators.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)