Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-33966

Fix the getNumRecordsInPerSecond Utility Function

    XMLWordPrintableJSON

Details

    Description

      We have following code in the codebase

              if (isSource && (numRecordsInPerSecond == null || numRecordsInPerSecond.getSum() == 0)) {
                  numRecordsInPerSecond =
                          flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_IN_PER_SEC);
              }
      
              if (isSource && (numRecordsInPerSecond == null || numRecordsInPerSecond.getSum() == 0)) {
                  numRecordsInPerSecond =
                          flinkMetrics.get(FlinkMetric.SOURCE_TASK_NUM_RECORDS_OUT_PER_SEC);
              }

      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.

      Attachments

        Issue Links

          Activity

            People

              yang Yang LI
              yang Yang LI
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: