def startTest(self, test, blocking_context=None): """Collect system stats for each dut""" self.current_test = {} for dut in self.dutlist: util = get_system_stats(ifc=dut['ssh']) self.current_test[dut['name']] = {'time': datetime.datetime.now(), 'mem': util['MEM'], 'cpuavg': util['CPUFORMATTED'], 'cpucore': util['CPUFORMATTEDPERCORE'], 'jvm': None } if self.jvm_stats: self.current_test[dut['name']]['jvm'] = self.retrieve_runtime(dut['rest'])
def startTest(self, test, blocking_context=None): """Collect system stats for each dut""" self.current_test = {} for dut in self.dutlist: util = get_system_stats(ifc=dut['ssh']) self.current_test[dut['name']] = { 'time': datetime.datetime.now(), 'mem': util['MEM'], 'cpuavg': util['CPUFORMATTED'], 'cpucore': util['CPUFORMATTEDPERCORE'], 'jvm': None } if self.jvm_stats: self.current_test[dut['name']]['jvm'] = self.retrieve_runtime( dut['rest'])
def stopTest(self, test): """Collect system stats for each dut and add pre and post stats to a result list """ for dut in self.dutlist: util = get_system_stats(ifc=dut['ssh']) pretest = self.current_test[dut['name']] posttest = {'time': datetime.datetime.now(), 'mem': util['MEM'], 'cpuavg': util['CPUFORMATTED'], 'cpucore': util['CPUFORMATTEDPERCORE'], 'jvm': None } if self.jvm_stats: posttest['jvm'] = self.retrieve_runtime(dut['rest']) dut['results'].append({'test': test, 'pretest': pretest, 'posttest': posttest})
def stopTest(self, test): """Collect system stats for each dut and add pre and post stats to a result list """ for dut in self.dutlist: util = get_system_stats(ifc=dut['ssh']) pretest = self.current_test[dut['name']] posttest = { 'time': datetime.datetime.now(), 'mem': util['MEM'], 'cpuavg': util['CPUFORMATTED'], 'cpucore': util['CPUFORMATTEDPERCORE'], 'jvm': None } if self.jvm_stats: posttest['jvm'] = self.retrieve_runtime(dut['rest']) dut['results'].append({ 'test': test, 'pretest': pretest, 'posttest': posttest })