def prepare_active_tasks(self, clusters): for cluster in clusters: settings = copy(self.settings) settings.cluster = cluster settings.master_node = self.clusters[cluster] collector = ActiveTasks(settings) try: sum(1 for _ in collector.get_buckets()) self.collectors.append(collector) except RuntimeError: pass
def main(): settings = Settings() settings.read_cfg() active_tasks = ActiveTasks(settings) if settings.update_metadata: active_tasks.update_metadata() while True: try: active_tasks.collect() time.sleep(settings.interval) except KeyboardInterrupt: break
def prepare_active_tasks(self, clusters): for cluster in clusters: settings = copy(self.settings) settings.cluster = cluster settings.master_node = self.clusters[cluster] self.collectors.append(ActiveTasks(settings))