

def fetch_metrics(self):
    for (index, metric_source) in enumerate(self.metric_sources):
        wait_time = random.uniform(0, (self.collector_config.period - 2))
        metric_source.task.metric_source_id = index
        metric_source.task.need_analyze = metric_source.need_analyze
        logger.info('%r waiting %f seconds for %s...', metric_source.task, wait_time, metric_source.url)
        reactor.callLater(wait_time, metric_source.fetch_metrics, self.input_queue)
    reactor.callLater((self.collector_config.period - 2), self.schedule_next_rolling)
    status_updater = StatusUpdater(self.collector_config)
    reactor.callLater((self.collector_config.period + 1), status_updater.produce_status_update_task, self.input_queue)
    region_operation_aggregator = RegionOperationMetricAggregator(self.collector_config)
    reactor.callLater((self.collector_config.period + 1), region_operation_aggregator.produce_aggregate_task, self.input_queue)
    reactor.run()

dataset/ETHPy150Open XiaoMi/minos/owl/collector/management/commands/collect.py Command.fetch_metrics/original