This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b717853e4c scheduler_job, add metric for scheduler loop timer (#27605)
b717853e4c is described below

commit b717853e4c17d67f8ea317536c98c7416eb080ca
Author: Michael Petro <[email protected]>
AuthorDate: Thu Nov 17 12:00:10 2022 -0500

    scheduler_job, add metric for scheduler loop timer (#27605)
---
 airflow/jobs/scheduler_job.py                      | 2 +-
 docs/apache-airflow/logging-monitoring/metrics.rst | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/airflow/jobs/scheduler_job.py b/airflow/jobs/scheduler_job.py
index 413bdf2fb8..eba3c27831 100644
--- a/airflow/jobs/scheduler_job.py
+++ b/airflow/jobs/scheduler_job.py
@@ -849,7 +849,7 @@ class SchedulerJob(BaseJob):
             )
 
         for loop_count in itertools.count(start=1):
-            with Stats.timer() as timer:
+            with Stats.timer("scheduler.scheduler_loop_duration") as timer:
 
                 if self.using_sqlite and self.processor_agent:
                     self.processor_agent.run_single_parsing_loop()
diff --git a/docs/apache-airflow/logging-monitoring/metrics.rst 
b/docs/apache-airflow/logging-monitoring/metrics.rst
index a5baa902d0..e81e10cab2 100644
--- a/docs/apache-airflow/logging-monitoring/metrics.rst
+++ b/docs/apache-airflow/logging-monitoring/metrics.rst
@@ -161,6 +161,7 @@ Name                                                
Description
                                                     start date and the actual 
DagRun start date
 ``scheduler.critical_section_duration``             Milliseconds spent in the 
critical section of scheduler loop --
                                                     only a single scheduler 
can enter this loop at a time
+``scheduler.scheduler_loop_duration``               Milliseconds spent running 
one scheduler loop
 ``dagrun.<dag_id>.first_task_scheduling_delay``     Seconds elapsed between 
first task start_date and dagrun expected start
 ``collect_db_dags``                                 Milliseconds taken for 
fetching all Serialized Dags from DB
 =================================================== 
========================================================================

Reply via email to