Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: tools/bisect-perf-regression.py

Issue 288843002: Fix bisect script to match a results with {mean, stddev} format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/bisect-perf-regression_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bisect-perf-regression.py
diff --git a/tools/bisect-perf-regression.py b/tools/bisect-perf-regression.py
index 80d87ef29d35005b8f121972f5affd48df27c7f7..2a921b843ce7139a655bf9a20d5afd66f7edff43 100755
--- a/tools/bisect-perf-regression.py
+++ b/tools/bisect-perf-regression.py
@@ -1945,31 +1945,42 @@ class BisectPerformanceMetrics(object):
A list of floating point numbers found.
"""
# Format is: RESULT <graph>: <trace>= <value> <units>
- metric_formatted = re.escape('RESULT %s: %s=' % (metric[0], metric[1]))
+ metric_re = re.escape('RESULT %s: %s=' % (metric[0], metric[1]))
+
+ # The log will be parsed looking for format:
+ # <*>RESULT <graph_name>: <trace_name>= <value>
+ single_result_re = re.compile(
+ metric_re + '\s*(?P<VALUE>[-]?\d*(\.\d*)?)')
+
+ # The log will be parsed looking for format:
+ # <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...]
+ multi_results_re = re.compile(
+ metric_re + '\s*\[\s*(?P<VALUES>[-]?[\d\., ]+)\s*\]')
+
+ # The log will be parsed looking for format:
+ # <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>}
+ mean_stddev_re = re.compile(
+ metric_re +
+ '\s*\{\s*(?P<MEAN>[-]?\d*(\.\d*)?),\s*(?P<STDDEV>\d+(\.\d*)?)\s*\}')
text_lines = text.split('\n')
values_list = []
-
for current_line in text_lines:
# Parse the output from the performance test for the metric we're
# interested in.
- metric_re = metric_formatted +\
- "(\s)*(?P<values>[0-9]+(\.[0-9]*)?)"
- metric_re = re.compile(metric_re)
- regex_results = metric_re.search(current_line)
-
- if not regex_results is None:
- values_list += [regex_results.group('values')]
- else:
- metric_re = metric_formatted +\
- "(\s)*\[(\s)*(?P<values>[0-9,.]+)\]"
- metric_re = re.compile(metric_re)
- regex_results = metric_re.search(current_line)
-
- if not regex_results is None:
- metric_values = regex_results.group('values')
-
- values_list += metric_values.split(',')
+ single_result_match = single_result_re.search(current_line)
+ multi_results_match = multi_results_re.search(current_line)
+ mean_stddev_match = mean_stddev_re.search(current_line)
+ if (not single_result_match is None and
+ single_result_match.group('VALUE')):
+ values_list += [single_result_match.group('VALUE')]
+ elif (not multi_results_match is None and
+ multi_results_match.group('VALUES')):
+ metric_values = multi_results_match.group('VALUES')
+ values_list += metric_values.split(',')
+ elif (not mean_stddev_match is None and
+ mean_stddev_match.group('MEAN')):
+ values_list += [mean_stddev_match.group('MEAN')]
values_list = [float(v) for v in values_list if IsStringFloat(v)]
« no previous file with comments | « no previous file | tools/bisect-perf-regression_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698