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

Unified Diff: tools/process_perf_combined.py

Issue 8439032: Add option to command tester for running a test multiple times. Use that (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: one more try Created 9 years, 1 month 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
Index: tools/process_perf_combined.py
===================================================================
--- tools/process_perf_combined.py (revision 0)
+++ tools/process_perf_combined.py (revision 0)
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import re
+import sys
+
+# Combine chromium-style perf log output from multiple runs.
+# Input is text *containing* the chrome buildbot perf format (may contain more)
+# but the output is only the merged perf data (throws away the rest).
+
+def ListToString(l):
+ return '[%s]' % (','.join(l))
+
+
+def Main():
+ usage = 'usage: %prog < stdin\n'
+ if len(sys.argv) != 1:
+ sys.stderr.write(usage)
+ sys.stderr.write('Instead, argv was %s\n' % str(sys.argv))
+ return 1
+ accumulated_times = {}
+ result_matcher = re.compile(r'^RESULT (.*): (.*)= (.*) (.*)$')
+ for line in sys.stdin.readlines():
+ match = result_matcher.match(line)
+ if match:
+ graph, trace, value, unit = match.groups()
+ key = (graph, trace)
+ value_list, old_unit = accumulated_times.get(key, ([], None))
+ if old_unit is not None:
+ assert(unit == old_unit)
Nick Bray 2011/11/11 22:42:39 assert(unit == old_unit), (unit, old_unit) is more
jvoung - send to chromium... 2011/11/11 23:28:27 Done
+ if type(value) == list:
Nick Bray 2011/11/11 22:42:39 isinstance(value, list)
jvoung - send to chromium... 2011/11/11 23:28:27 Done.
+ value_list += value
+ else:
+ value_list += [value]
+ accumulated_times[key] = (value_list, unit)
+ for ((graph, trace), (values, unit)) in accumulated_times.iteritems():
+ sys.stdout.write('RESULT %s: %s= %s %s\n' %
+ (graph, trace, ListToString(values), unit))
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(Main())
Property changes on: tools/process_perf_combined.py
___________________________________________________________________
Added: svn:eol-style
+ LF
« tools/command_tester.py ('K') | « tools/command_tester.py ('k') | tools/test_lib.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698