def _emit_metrics(self, missing_datetimes, finite_start, finite_stop):
        """
        For consistent metrics one should consider the entire range, but
        it is open (infinite) if stop or start is None.

        Hence make do with metrics respective to the finite simplification.
        """
        datetimes = self.finite_datetimes(
            finite_start if self.start is None else min(finite_start, self.parameter_to_datetime(self.start)),
            finite_stop if self.stop is None else max(finite_stop, self.parameter_to_datetime(self.stop)))

        delay_in_jobs = len(datetimes) - datetimes.index(missing_datetimes[0]) if datetimes and missing_datetimes else 0
        self.trigger_event(RangeEvent.DELAY, self.of_cls.task_family, delay_in_jobs)

        expected_count = len(datetimes)
        complete_count = expected_count - len(missing_datetimes)
        self.trigger_event(RangeEvent.COMPLETE_COUNT, self.of_cls.task_family, complete_count)
        self.trigger_event(RangeEvent.COMPLETE_FRACTION, self.of_cls.task_family, float(complete_count) / expected_count if expected_count else 1)
def _emit_metrics ( self , missing_datetimes , finite_start , finite_stop ) : datetimes = self . finite_datetimes ( finite_start if self . start is None else min ( finite_start , self . parameter_to_datetime ( self . start ) ) , finite_stop if self . stop is None else max ( finite_stop , self . parameter_to_datetime ( self . stop ) ) ) delay_in_jobs = len ( datetimes ) - datetimes . index ( missing_datetimes [ 0 ] ) if datetimes and missing_datetimes else 0 self . trigger_event ( RangeEvent . DELAY , self . of_cls . task_family , delay_in_jobs ) expected_count = len ( datetimes ) complete_count = expected_count - len ( missing_datetimes ) self . trigger_event ( RangeEvent . COMPLETE_COUNT , self . of_cls . task_family , complete_count ) self . trigger_event ( RangeEvent . COMPLETE_FRACTION , self . of_cls . task_family , float ( complete_count ) / expected_count if expected_count else 1 )
For consistent metrics one should consider the entire range, but
        it is open (infinite) if stop or start is None.

        Hence make do with metrics respective to the finite simplification.