aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/check_bench_regressions.py
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-17 21:16:29 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-17 21:16:29 +0000
commitb1bcb21631275fd5d0f5313b1ea37d0b975c066a (patch)
tree003726316953d421be1e2940d6474b36de4dceca /bench/check_bench_regressions.py
parentbab3fc4c90c4369c5d77d8da86d9f117ee54e0bc (diff)
gen_bench_expectations to generate bench expectations files.
BUG=skia:2225 NOTRY=true R=borenet@google.com Author: bensong@google.com Review URL: https://codereview.chromium.org/201423002 git-svn-id: http://skia.googlecode.com/svn/trunk@13838 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/check_bench_regressions.py')
-rw-r--r--bench/check_bench_regressions.py35
1 files changed, 2 insertions, 33 deletions
diff --git a/bench/check_bench_regressions.py b/bench/check_bench_regressions.py
index 48ce180a39..8f648dc2b0 100644
--- a/bench/check_bench_regressions.py
+++ b/bench/check_bench_regressions.py
@@ -80,35 +80,6 @@ class Label:
hash(self.time_type) ^
hash(frozenset(self.settings.iteritems())))
-def parse_dir(directory, default_settings, revision, rep):
- """Parses bench data from bench logs files.
- revision can be either svn revision or git commit hash.
- """
- revision_data_points = [] # list of BenchDataPoint
- file_list = os.listdir(directory)
- file_list.sort()
- for bench_file in file_list:
- scalar_type = None
- # Scalar type, if any, is in the bench filename after revision
- if (len(revision) > MAX_SVN_REV_LENGTH and
- bench_file.startswith('bench_' + revision + '_')):
- # The revision is GIT commit hash.
- scalar_type = bench_file[len(revision) + len('bench_') + 1:]
- elif (bench_file.startswith('bench_r' + revision + '_') and
- revision.isdigit()):
- # The revision is SVN number
- scalar_type = bench_file[len(revision) + len('bench_r') + 1:]
- else:
- continue
-
- file_handle = open(directory + '/' + bench_file, 'r')
-
- default_settings['scalar'] = scalar_type
- revision_data_points.extend(
- bench_util.parse(default_settings, file_handle, rep))
- file_handle.close()
- return revision_data_points
-
def create_bench_dict(revision_data_points):
"""Convert current revision data into a dictionary of line data.
@@ -206,6 +177,7 @@ def check_expectations(lines, expectations, key_suffix):
if outputs:
raise Exception('\n'.join(outputs))
+
def main():
"""Parses command line and checks bench expectations."""
try:
@@ -248,10 +220,7 @@ def main():
platform_and_alg = bot + '-' + rep
- data_points = parse_dir(directory,
- {}, # Sets default settings to empty.
- rev,
- rep)
+ data_points = bench_util.parse_skp_bench_data(directory, rev, rep)
bench_dict = create_bench_dict(data_points)