Home | History | Annotate | Download | only in bench

Lines Matching full:bench

6 """ Analyze recent bench data from graphs, and output suggested ranges.
10 bench ranges to use in bench_expectations.txt, with analytical plots.
23 # Constants for calculating suggested bench ranges.
25 # We use moving average as expected bench value, and calculate average Variance
26 # of bench from the moving average. Set range to be [X_UB * Variance above
44 # List of bench representation algorithms. Flag "-a" is chosen from the list.
47 # Regular expressions for parsing bench/revision values.
48 HEIGHT_RE = 'height (\d+\.\d+) corresponds to bench value (\d+\.\d+).-->'
50 LINE_RE = '<polyline id="(.*)".*points="(.*)"/>' # Bench value lines.
52 # Bench graph url pattern.
57 HTML_HEAD = ('<html><head><title>Skia Bench Expected Ranges</title>'
61 'bench/bench_expectations.txt.<br><br>')
65 'document.getElementById("%s"),"rev,bench,alert\\n')
74 print '-b <bench-prefix>: prefix of matching bench names to analyze.'
82 """Returns a dict of matching bench values from the given xhtml page.
84 page: substring used to construct the specific bench graph URL to fetch.
88 a dict mapping benchmark name and revision combinations to bench values.
113 bench = line_match.group(1)
114 bench = bench[:bench.find('_{')]
115 if not bench.startswith(bench_prefix):
117 if bench not in val_dic:
118 val_dic[bench] = {}
121 if len(vals) < WINDOW: # Too few bench data points; skip.
126 if x <= x_axes[i]: # Found corresponding bench revision.
128 val_dic[bench][revisions[i]] = float(
133 def CreateBenchOutput(page, bench, val_dic):
134 """Returns output for the given page and bench data in dict.
136 page: substring of bench graph webpage, to indicate the bench platform.
137 bench: name of the benchmark to process.
141 string of html/javascript as part of the whole script output for the bench.
143 revs = val_dic[bench].keys()
145 # Uses moving average to calculate expected bench variance, then sets
151 points.append(val_dic[bench][rev])
169 graph_id = '%s_%s' % (bench, page.replace('-', '_'))
170 expectations = '%s,%s,%.2f,%.2f,%.2f' % (bench, page, moving_avgs[-1],
214 raise Exception('Must provide nonempty Flag -b (bench name prefix).')
227 # Iterates through bench graph xhtml pages for oututting matching benches.
230 for bench in bench_value_dict:
231 body += CreateBenchOutput(page, bench, bench_value_dict) + GRAPH_SUFFIX
234 raise Exception('No bench outputs. Most likely there are no matching bench'
236 'check if the bench graph URLs are valid at %s.' % (