def parse_most_cgi_args(self): self.myurl = os.path.basename(sys.argv[0]) self.cgiform = cgi.FieldStorage(keep_blank_values=True) self.size = self.cgiform.getvalue('size', '1200,850') all_toggles = set(('absolute', 'regress', 'dark', 'by_hosts')) self.toggles = set(tog for tog in all_toggles if tog in self.cgiform) platforms = self.cgiform.getvalue('platforms', '') if '.' in platforms: self.toggles.add('by_hosts') self.passthru = list(self.toggles) self.relative = 'absolute' not in self.toggles if platforms: self.passthru.append('platforms=%s' % platforms) self.platforms_filter = platforms.split(',') else: self.platforms_filter = [] self.test_attributes = perf.parse_test_attr_args(self.cgiform) perf.append_cgi_args(self.passthru, self.test_attributes) test = self.cgiform.getvalue('test', '') if 'antag' in self.cgiform: antagonists = ','.join(self.cgiform.getlist('antag')) # antag=* # or antag=test1,test2,test3,... # or antag=test1&antag=test2&... # testN is empty for solo case of no antagonist self.passthru.append('antag=%s' % antagonists) else: antagonists = None # not same as '' return test, antagonists
def table_variants_all_tests(plot_data, columns, colkeys, benchmarks, myurl, filtered_passthru): # generate html table of graph's numbers # for primary metric over all benchmarks (rows), # on one platform and one kernel, # over various combos of test run attribute constraints (cols). ref_thresholds = {} print "<table border=1 cellpadding=3 cellspacing=0>" print "<tr> <td><b> Benchmark </b></td>", for col in columns: print "<td><b>", colkeys[col].replace(',', ',<br>'), "</b></td>" print "</tr>" for benchmark in benchmarks: print "<tr> <td><b>", benchmark, "</b></td>" for col in columns: print "<td>", vals = plot_data[col].get(benchmark, []) if not vals: print "?", else: (avg, std_dev) = plotgraph.avg_dev(vals) args = filtered_passthru[:] perf.append_cgi_args(args, {'test': benchmark}) for keyval in colkeys[col].split(','): key, val = keyval.split('=', 1) perf.append_cgi_args(args, {key: val}) print "<a href='%s?%s&runs&attrs'>" % (myurl, '&'.join(args)) print "<b>%.4g</b>" % avg, "</a><br>", print " <small> %dr </small>" % len(vals), print " <small> %.3g </small>" % std_dev, print "</td>" print "</tr>\n" print "</table>" print "<p> <b>Bold value:</b> Average of this metric, then <br>" print "number of good test runs, then standard deviation of those runs"
def parse_most_cgi_args(self): self.myurl = os.path.basename(sys.argv[0]) self.cgiform = cgi.FieldStorage(keep_blank_values=True) self.size = self.cgiform.getvalue("size", "1200,850") all_toggles = set(("absolute", "regress", "dark", "by_hosts")) self.toggles = set(tog for tog in all_toggles if tog in self.cgiform) platforms = self.cgiform.getvalue("platforms", "") if "." in platforms: self.toggles.add("by_hosts") self.passthru = list(self.toggles) self.relative = "absolute" not in self.toggles if platforms: self.passthru.append("platforms=%s" % platforms) self.platforms_filter = platforms.split(",") else: self.platforms_filter = [] self.test_attributes = perf.parse_test_attr_args(self.cgiform) perf.append_cgi_args(self.passthru, self.test_attributes) test = self.cgiform.getvalue("test", "") if "antag" in self.cgiform: antagonists = ",".join(self.cgiform.getlist("antag")) # antag=* # or antag=test1,test2,test3,... # or antag=test1&antag=test2&... # testN is empty for solo case of no antagonist self.passthru.append("antag=%s" % antagonists) else: antagonists = None # not same as '' return test, antagonists
def table_variants_all_tests(plot_data, columns, colkeys, benchmarks, myurl, filtered_passthru): # generate html table of graph's numbers # for primary metric over all benchmarks (rows), # on one platform and one kernel, # over various combos of test run attribute constraints (cols). ref_thresholds = {} print "<table border=1 cellpadding=3 cellspacing=0>" print "<tr> <td><b> Benchmark </b></td>", for col in columns: print "<td><b>", colkeys[col].replace(",", ",<br>"), "</b></td>" print "</tr>" for benchmark in benchmarks: print "<tr> <td><b>", benchmark, "</b></td>" for col in columns: print "<td>", vals = plot_data[col].get(benchmark, []) if not vals: print "?", else: (avg, std_dev) = plotgraph.avg_dev(vals) args = filtered_passthru[:] perf.append_cgi_args(args, {"test": benchmark}) for keyval in colkeys[col].split(","): key, val = keyval.split("=", 1) perf.append_cgi_args(args, {key: val}) print "<a href='%s?%s&runs&attrs'>" % (myurl, "&".join(args)) print "<b>%.4g</b>" % avg, "</a><br>", print " <small> %dr </small>" % len(vals), print " <small> %.3g </small>" % std_dev, print "</td>" print "</tr>\n" print "</table>" print "<p> <b>Bold value:</b> Average of this metric, then <br>" print "number of good test runs, then standard deviation of those runs"
def table_1_metric_all_kernels(plot_data, columns, column_argname, kernels, kernel_dates, myurl, filtered_passthru): # generate html table of graph's numbers # for 1 benchmark metric over all kernels (rows), # over various platforms or various antagonists etc (cols). ref_thresholds = {} print "<table border=1 cellpadding=3 cellspacing=0>" print "<tr> <td><b> Kernel </b></td>", for label in columns: if not label and column_argname == 'antag': label = 'no antag' print "<td><b>", label.replace('_', '<br>_'), "</b></td>" print "</tr>" for kernel in kernels: print "<tr> <td><b>", kernel, "</b>", if kernel in kernel_dates: print "<br><small>", kernel_dates[kernel], "</small>" print "</td>" for col in columns: print "<td", vals = plot_data[col].get(kernel, []) if not vals: print "> ?", else: (avg, std_dev) = plotgraph.avg_dev(vals) if col not in ref_thresholds: ref_thresholds[col] = avg - std_dev if avg + std_dev < ref_thresholds[col]: print "bgcolor=pink", print "> ", args = filtered_passthru[:] perf.append_cgi_args(args, { column_argname: col, 'kernel': kernel }) print "<a href='%s?%s&runs&attrs'>" % (myurl, '&'.join(args)) print "<b>%.4g</b>" % avg, "</a><br>", print " <small> %dr </small>" % len(vals), print " <small> %.3g </small>" % std_dev, print "</td>" print "</tr>\n" print "</table>" print "<p> <b>Bold value:</b> Average of this metric, then <br>" print "number of good test runs, then standard deviation of those runs" print "<br> Pink if regressed from reference kernel"
def table_1_metric_all_kernels(plot_data, columns, column_argname, kernels, kernel_dates, myurl, filtered_passthru): # generate html table of graph's numbers # for 1 benchmark metric over all kernels (rows), # over various platforms or various antagonists etc (cols). ref_thresholds = {} print "<table border=1 cellpadding=3 cellspacing=0>" print "<tr> <td><b> Kernel </b></td>", for label in columns: if not label and column_argname == "antag": label = "no antag" print "<td><b>", label.replace("_", "<br>_"), "</b></td>" print "</tr>" for kernel in kernels: print "<tr> <td><b>", kernel, "</b>", if kernel in kernel_dates: print "<br><small>", kernel_dates[kernel], "</small>" print "</td>" for col in columns: print "<td", vals = plot_data[col].get(kernel, []) if not vals: print "> ?", else: (avg, std_dev) = plotgraph.avg_dev(vals) if col not in ref_thresholds: ref_thresholds[col] = avg - std_dev if avg + std_dev < ref_thresholds[col]: print "bgcolor=pink", print "> ", args = filtered_passthru[:] perf.append_cgi_args(args, {column_argname: col, "kernel": kernel}) print "<a href='%s?%s&runs&attrs'>" % (myurl, "&".join(args)) print "<b>%.4g</b>" % avg, "</a><br>", print " <small> %dr </small>" % len(vals), print " <small> %.3g </small>" % std_dev, print "</td>" print "</tr>\n" print "</table>" print "<p> <b>Bold value:</b> Average of this metric, then <br>" print "number of good test runs, then standard deviation of those runs" print "<br> Pink if regressed from reference kernel"