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

Unified Diff: mojo/devtools/common/mojo_benchmark

Issue 1442623002: Improve presentation of aggregate results in mojo_benchmark. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/mojo_benchmark
diff --git a/mojo/devtools/common/mojo_benchmark b/mojo/devtools/common/mojo_benchmark
index 9a4803c78052726e6b084f11e2584cfe5f6d0742..e01ff627d22e63ea5633b9682e801f7b04cf3655 100755
--- a/mojo/devtools/common/mojo_benchmark
+++ b/mojo/devtools/common/mojo_benchmark
@@ -7,6 +7,7 @@
import argparse
import logging
+import numpy
import sys
import time
@@ -70,6 +71,16 @@ def _print_benchmark_error(outcome):
print '-' * 72
+def _format_vector(results):
+ if not len(results):
+ return "med -, avg -, std-dev -, (no results)"
+
+ return "med %f, avg %f, std-dev %f %s" % (numpy.median(results),
+ numpy.mean(results),
+ numpy.std(results),
+ str(results))
+
+
def _print_results(benchmark_name, variant_name, results, measurements,
aggregate):
print '[ %s ] %s ' % (benchmark_name, variant_name)
@@ -77,7 +88,7 @@ def _print_results(benchmark_name, variant_name, results, measurements,
print ' ' + measurement['name'] + ': ',
if measurement['spec'] in results:
if aggregate:
- print str(results[measurement['spec']])
+ print _format_vector(results[measurement['spec']])
else:
if len(results[measurement['spec']]) == 0:
print '?'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698