aircal/events.py
def _estimate_dag_exec_time(self):
        """
        Estimate execution time of the future DAG run.

        Takes an average of last 5 runs by default.
        """
        df_dag_run = self.airflow_db.load_dag_run_metadata()
        df_dag_run.start_date = pd.to_datetime(df_dag_run.start_date)
        df_dag_run.end_date = pd.to_datetime(df_dag_run.end_date)
        df_dag_run['exec_time'] = df_dag_run.end_date - df_dag_run.start_date

        df_et = df_dag_run.groupby('dag_id').\
            apply(lambda x: x.nlargest(self.n_last_runs, 'start_date')).reset_index(drop=True)
        df_met = df_et.groupby('dag_id')['exec_time'].agg(['sum', 'size'])
        df_met['mean_exec_time'] = df_met['sum'] / df_met['size']
        return df_met.drop(columns=['sum', 'size'])

        Estimate execution time of the future DAG run.

        Takes an average of last 5 runs by default.
        
Estimate execution time of the future DAG run.
Takes an average of last 5 runs by default.
Estimate execution time of the future DAG run . Takes an average of last 5 runs by default .
def _estimate_dag_exec_time(self):
        df_dag_run = self.airflow_db.load_dag_run_metadata()
        df_dag_run.start_date = pd.to_datetime(df_dag_run.start_date)
        df_dag_run.end_date = pd.to_datetime(df_dag_run.end_date)
        df_dag_run['exec_time'] = df_dag_run.end_date - df_dag_run.start_date
        df_et = df_dag_run.groupby('dag_id').\
            apply(lambda x: x.nlargest(self.n_last_runs, 'start_date')).reset_index(drop=True)
        df_met = df_et.groupby('dag_id')['exec_time'].agg(['sum', 'size'])
        df_met['mean_exec_time'] = df_met['sum'] / df_met['size']
        return df_met.drop(columns=['sum', 'size'])
def _estimate_dag_exec_time ( self ) : df_dag_run = self . airflow_db . load_dag_run_metadata ( ) df_dag_run . start_date = pd . to_datetime ( df_dag_run . start_date ) df_dag_run . end_date = pd . to_datetime ( df_dag_run . end_date ) df_dag_run [ 'exec_time' ] = df_dag_run . end_date - df_dag_run . start_date df_et = df_dag_run . groupby ( 'dag_id' ) . apply ( lambda x : x . nlargest ( self . n_last_runs , 'start_date' ) ) . reset_index ( drop = True ) df_met = df_et . groupby ( 'dag_id' ) [ 'exec_time' ] . agg ( [ 'sum' , 'size' ] ) df_met [ 'mean_exec_time' ] = df_met [ 'sum' ] / df_met [ 'size' ] return df_met . drop ( columns = [ 'sum' , 'size' ] )
Estimate execution time of the future DAG run.
Estimate execution time of the future DAG run .
"""
        Estimate execution time of the future DAG run.

        Takes an average of last 5 runs by default.
        """
self