[ 
https://issues.apache.org/jira/browse/FLINK-33966?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated FLINK-33966:
-----------------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Minor
>              Labels: pull-request-available
>
> 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)

Reply via email to