feng-tao commented on a change in pull request #5890: [AIRFLOW-5274] dag 
loading duration metric name too long
URL: https://github.com/apache/airflow/pull/5890#discussion_r318285536
 
 

 ##########
 File path: airflow/models/dagbag.py
 ##########
 @@ -408,13 +405,11 @@ def collect_dags(
         self.dagbag_stats = sorted(
             stats, key=lambda x: x.duration, reverse=True)
         for file_stat in self.dagbag_stats:
-            dag_ids = dags_by_name[file_stat.dags]
-            if file_stat.dag_num >= 1:
-                # if we found multiple dags per file, the stat is 'dag_id1 _ 
dag_id2'
-                dag_names = '_'.join(dag_ids)
-                Stats.timing('dag.loading-duration.{}'.
-                             format(dag_names),
-                             file_stat.duration)
+            # file_stat.file similar format: /subdir/dag_name.py
+            filename = file_stat.file.split('/')[-1].replace('.py', '')
 
 Review comment:
   I think it would be a bad practice to have the same file name for different 
DAGs. If you think this would be an issue on your side, feel free to raise a pr.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to