def score(self, table=None, file=None): if self.runner.bench_csv_file is None: return (False, None, 0) error = False total_score = 0 if len(self.scores) != 0: is_first = True nb_score = 0 #print (self.getFullName()) for score in self.scores: if self.runner.bench_csv_file.get(score.name) is None: value = 0 score_value = 0.0 else: value, desc = self.runner.bench_csv_file.get(score.name) value = float(value) try: score_value = eval(score.score) except: score_value = 0.0 name = self.getFullName() if is_first else "" is_first = False if table is not None: table.add_row( [name, score.name, desc, value, score_value]) #print ('\t%s\t%f' % (score.name, score_value)) if score.checker is not None: score.value = value score.score = score_value error = error or score.checker(score) total_score += score_value nb_score += 1 if nb_score > 0: total_score = total_score / nb_score plot = plptest_bench.Jenkins_plot(self.getFullName() + '.score.csv') plot.append('score', str(total_score)) plot.gen() return (error, total_score, 1) else: return (error, None, 0)
def score(self, table=None, file=None): error = False score = 0.0 nb_score = 0 for child in self.childs: (child_error, child_score, child_nb_score) = child.score(table=table, file=file) error = error or child_error if child_nb_score == 0: continue score += child_score nb_score += child_nb_score if nb_score > 0: score = score / nb_score plot = plptest_bench.Jenkins_plot(self.getFullName() + '.score.csv') plot.append('score', str(score)) plot.gen() return (error, score, 1) else: return (error, None, 0)
def score(self, table=None, file=None): score = 0.0 nb_score = 0 for child in self.childs: (child_score, child_nb_score) = child.score(table=table, file=file) score += child_score nb_score += child_nb_score if nb_score > 0: score = score / nb_score plot = plptest_bench.Jenkins_plot(self.getFullName() + '.score.csv') plot.append('score', str(score)) plot.gen() return (score, 1)
def score(self, table=None, file=None): total_score = 0 if len(self.scores) != 0: is_first = True nb_score = 0 #print (self.getFullName()) for score in self.scores: if self.runner.bench_csv_file.get(score.name) is None: raise Exception("Unknown benchmark item: " + score.name) value, desc = self.runner.bench_csv_file.get(score.name) value = float(value) score_value = eval(score.score) name = self.getFullName() if is_first else "" is_first = False table.add_row([name, score.name, desc, value, score_value]) #print ('\t%s\t%f' % (score.name, score_value)) total_score += score_value nb_score += 1 if nb_score > 0: total_score = total_score / nb_score plot = plptest_bench.Jenkins_plot(self.getFullName() + '.score.csv') plot.append('score', str(total_score)) plot.gen() return (total_score, 1)