airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] ashb commented on a change in pull request #6342: [AIRFLOW-5662] fix incorrect naming for scheduler used slot metric
Date Thu, 17 Oct 2019 10:08:54 GMT
ashb commented on a change in pull request #6342: [AIRFLOW-5662] fix incorrect naming for scheduler
used slot metric
URL: https://github.com/apache/airflow/pull/6342#discussion_r335910327
 
 

 ##########
 File path: airflow/models/pool.py
 ##########
 @@ -107,3 +109,33 @@ def open_slots(self, session):
         Returns the number of slots open at the moment
         """
         return self.slots - self.occupied_slots(session)
+
+    @provide_session
+    def slots_stats(self, session) -> Dict:
+        from airflow.models.taskinstance import TaskInstance  # Avoid circular import
+
+        states_filter = STATES_TO_COUNT_AS_RUNNING | frozenset([State.RUNNING, State.QUEUED])
 
 Review comment:
   Please remove it - the variable name very clearly describes its purpose, and if we add
any new states to that set it is because we want them to count as running :)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message