diff options
author | cmp@chromium.org <cmp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 22:08:11 +0000 |
---|---|---|
committer | cmp@chromium.org <cmp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 22:08:11 +0000 |
commit | 0db8598df29bebe678f6d041e8f950b763ef77e5 (patch) | |
tree | 14f16ae02894e0e85b9340a8cc7145c096229b5f /tools/perf_expectations | |
parent | 35784d3a3351974aa35698431dfd978a094b95f3 (diff) | |
download | chromium_src-0db8598df29bebe678f6d041e8f950b763ef77e5.zip chromium_src-0db8598df29bebe678f6d041e8f950b763ef77e5.tar.gz chromium_src-0db8598df29bebe678f6d041e8f950b763ef77e5.tar.bz2 |
Support absolute perf expectations.
BUG=none
TEST=stores absolute perf values if type is set correctly
Review URL: http://codereview.chromium.org/6713114
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79459 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf_expectations')
-rwxr-xr-x | tools/perf_expectations/make_expectations.py | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/tools/perf_expectations/make_expectations.py b/tools/perf_expectations/make_expectations.py index c19cea5..4f8cc0f 100755 --- a/tools/perf_expectations/make_expectations.py +++ b/tools/perf_expectations/make_expectations.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -76,7 +76,16 @@ def WriteJson(filename, data, keys): jsondata = [] for key in keys: rowdata = [] - for subkey in ['reva', 'revb', 'improve', 'regress']: + # Numbers, these come first. + for subkey in ['reva', 'revb']: + if subkey in data[key]: + rowdata.append('"%s": %s' % (subkey, data[key][subkey])) + # Strings, like type, come next. + for subkey in ['type']: + if subkey in data[key]: + rowdata.append('"%s": "%s"' % (subkey, data[key][subkey])) + # Finally improve/regress numbers come last. + for subkey in ['improve', 'regress']: if subkey in data[key]: rowdata.append('"%s": %s' % (subkey, data[key][subkey])) jsondata.append('"%s": {%s}' % (key, ', '.join(rowdata))) @@ -140,9 +149,15 @@ def Main(args): print '%s (skipping, missing json data)' % key continue + # Set value's type to 'relative' by default. + value_type = value.get('type', 'relative') + summarylist = summaryjson.split('\n') trace_values = {} - for trace in [tracename, reftracename]: + traces = [tracename] + if value_type == 'relative': + traces += [reftracename] + for trace in traces: trace_values.setdefault(trace, {}) # Find the high and low values for each of the traces. @@ -158,7 +173,7 @@ def Main(args): # We found the upper revision in the range. Scan for trace data until we # find the lower revision in the range. if scanning: - for trace in [tracename, reftracename]: + for trace in traces: if trace not in json['traces']: if not printed_error: print '%s (error)' % key @@ -193,12 +208,19 @@ def Main(args): print '%s (skipping, no suitable traces matched)' % key continue - # Calculate assuming high deltas are regressions and low deltas are - # improvements. - regress = (float(trace_values[tracename]['high']) - - float(trace_values[reftracename]['low'])) - improve = (float(trace_values[tracename]['low']) - - float(trace_values[reftracename]['high'])) + if value_type == 'relative': + # Calculate assuming high deltas are regressions and low deltas are + # improvements. + regress = (float(trace_values[tracename]['high']) - + float(trace_values[reftracename]['low'])) + improve = (float(trace_values[tracename]['low']) - + float(trace_values[reftracename]['high'])) + elif value_type == 'absolute': + # Calculate assuming high absolutes are regressions and low absolutes are + # improvements. + regress = float(trace_values[tracename]['high']) + improve = float(trace_values[tracename]['low']) + # If the existing values assume regressions are low deltas relative to # improvements, swap our regress and improve. This value must be a # scores-like result. |