示例#1
0
 def makeBaseline(self, hosts):
     super().makeBaseline(hosts)
     opts = self.options.pingOptions + [self.lp[host].address for host in hosts]
     resContainer = self.TestResult()
     WatcherServices.doStandaloneTest(self.PING_TEST_NAME, opts, resContainer.addResult, resContainer.addError)
     resContainer.resultCollected.wait()
     redoBl = []
     for host, ping in resContainer.results.items():
         # check that values are consistent, redo if not
         if ping.rttdev > self.options.rttdevThreshold:
             redoBl.append(host)
         self.lp[host].baseline = ping
     if len(redoBl) > 0:
         self.logger.info("Retaking baseline for %s", repr(redoBl))
         print("Retaking baseline for %s" % repr(redoBl))
         self.makeBaseline(redoBl)
示例#2
0
 def makeMeasures(self, s):
     opts = self.options.pingOptions + [probe.address for probe in s]
     resContainer = self.TestResult()
     WatcherServices.doStandaloneTest(self.PING_TEST_NAME, opts, resContainer.addResult, resContainer.addError)
     # protect against tests hanging
     resContainer.resultCollected.wait(30)
     if not resContainer.resultCollected.is_set():
         self.makeMeasures(s)
         return
     redoMeasure = []
     for host, ping in resContainer.results.items():
         if ping.rttdev > self.options.rttdevThreshold:
             redoMeasure.append(self.lp[host])
         self.lp[host].add(ping)
     if len(redoMeasure) > 0:
         self.logger.info("Retaking measure for %s", repr(redoMeasure))
         print("Retaking measure for %s" % repr(redoMeasure))
         self.makeMeasures(redoMeasure)