dkranchii opened a new pull request, #68152: URL: https://github.com/apache/airflow/pull/68152
## Summary Wrap `_process_executor_events()` in a per-executor `stats.timer` named `scheduler.executor_events_duration`, tagged by executor class name. In multi-executor deployments, operators can now attribute per-loop event-processing cost to each configured executor instead of seeing it only in the aggregate `scheduler.scheduler_loop_duration`. This mirrors #66808, which added `scheduler.executor_heartbeat_duration` for `executor.heartbeat()`. The two timers sit side-by-side, so operators can localise which stage of the scheduler loop a given executor is slowing down. ## Why When the scheduler loop runs long in a multi-executor deployment, `scheduler.scheduler_loop_duration` alone does not tell you which executor's event processing is to blame. A per-executor timer around `_process_executor_events` gives the same granular signal the heartbeat timer already provides — additive, zero-cost when metrics are disabled. ## Test plan - New unit test `test_process_executor_events_emits_timer` asserts the timer is emitted once per executor with the expected tag. - Existing `test_executor_heartbeat_emits_timer` still passes. - `prek run --from-ref main --stage pre-commit` and `--stage manual` clean (excluding host-only mypy/breeze hooks; CI will run them). --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Used Cursor -- 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]
