Beispiel #1
0
    def run(self):
        # TODO : remove lines
        import time
        while len(WatcherServices.getAllOtherProbes()) < self.options.overlay_size - 1:
            self.logger.info("Length of other probes %s", len(WatcherServices.getAllOtherProbes()))
            time.sleep(10)
        WatcherServices.writeOutput('up', '1', 'w')
        time.sleep(45)
        from managers.actions import ActionMan

        ActionMan.actionQueue.join()
        # self.initializeEvent.set()
        while not self.stop:
            self.initializeEvent.wait()
            self.initialize()
            self.initializeEvent.clear()
            WatcherServices.writeOutput('events', '1', 'w')
            # work until new initialisation is asked
            while not self.stop and not self.initializeEvent.is_set():
                while not self.initializeEvent.is_set() and not self.workEvent.is_set():
                    self.workEvent.wait(2.0)
                if self.initializeEvent.is_set():
                    break
                try:
                    self.work()
                    self._resetWork()
                    self.workEvent.clear()
                finally:
                    WatcherServices.writeOutput('done', '1', 'w')
Beispiel #2
0
 def setLp(self):
     self.lp = {p.address: self.newProbe(p.address, p.id, self.measureClass) for p in WatcherServices.getAllOtherProbes()}