Index: tools/buildbot/scripts/slave/chromium/dom_perf.py |
=================================================================== |
--- tools/buildbot/scripts/slave/chromium/dom_perf.py (revision 23577) |
+++ tools/buildbot/scripts/slave/chromium/dom_perf.py (working copy) |
@@ -65,36 +65,54 @@ |
if options.target == 'Debug': |
iterations = '&minIterations=1' |
- # Windows used to write to the root of C:, but that doesn't work |
- # on Vista so we write into the build folder instead. |
- output_file = os.path.join(build_dir, options.target, |
- 'dom_perf_result_%s.txt' % build_revision) |
+ def run_and_print(use_refbuild): |
+ # Windows used to write to the root of C:, but that doesn't work |
+ # on Vista so we write into the build folder instead. |
+ suffix = '' |
+ if (use_refbuild): |
+ suffix = '_ref' |
+ output_file = os.path.join(build_dir, options.target, |
+ 'dom_perf_result_%s%s.txt' % (build_revision, |
+ suffix)) |
- url = URL % (dom_perf_dir, iterations, build_revision) |
- url_flag = '--url=%s' % url |
+ url = URL % (dom_perf_dir, iterations, build_revision) |
+ url_flag = '--url=%s' % url |
- command = [test_exe_path, |
- '--wait_cookie_name=__domperf_finished', |
- '--jsvar=__domperf_result', |
- '--jsvar_output=%s' % output_file, |
- url_flag] |
+ command = [test_exe_path, |
+ '--wait_cookie_name=__domperf_finished', |
+ '--jsvar=__domperf_result', |
+ '--jsvar_output=%s' % output_file, |
+ url_flag] |
+ if use_refbuild: |
+ command.append('--reference_build') |
- print "Executing: " |
- print command |
- result = chromium_utils.RunCommand(command) |
+ print "Executing: " |
+ print command |
+ result = chromium_utils.RunCommand(command) |
- # Open the resulting file and display it. |
- file = open(output_file, 'r') |
- data = json.loads(''.join(file.readlines())) |
- file.close() |
+ # Open the resulting file and display it. |
+ file = open(output_file, 'r') |
+ data = json.loads(''.join(file.readlines())) |
+ file.close() |
+ name = 'Total' |
+ if use_refbuild: |
+ name += '_ref' |
+ print_result(True, name, data['BenchmarkRun']['totalScore']) |
+ for suite in data['BenchmarkSuites']: |
+ name = suite['name'] |
+ if use_refbuild: |
+ name += '_ref' |
+ print_result(False, name, suite['score']) |
+ |
+ return result |
+ |
+ result = run_and_print(False) |
+ result &= run_and_print(True) |
+ |
if chromium_utils.IsLinux(): |
slave_utils.StopVirtualX(options.target) |
- print_result(True, 'Total', data['BenchmarkRun']['totalScore']) |
- for suite in data['BenchmarkSuites']: |
- print_result(False, suite['name'], suite['score']) |
- |
return result |