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

Unified Diff: mojo/devtools/common/devtoolslib/benchmark.py

Issue 1915443002: Enable the use of spaces within a benchmark measurement name (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 8 months 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 | « apps/benchmark/run_args.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/devtoolslib/benchmark.py
diff --git a/mojo/devtools/common/devtoolslib/benchmark.py b/mojo/devtools/common/devtoolslib/benchmark.py
index e55a88465d0b9d5f9afd2d55a4ff7035cfac86f3..f44cfdbaaf2746c4e1178e65c131d4a83afd545c 100644
--- a/mojo/devtools/common/devtoolslib/benchmark.py
+++ b/mojo/devtools/common/devtoolslib/benchmark.py
@@ -5,6 +5,7 @@
"""Logic that drives runs of the benchmarking mojo app and parses its output."""
import os.path
+import pipes
import re
_BENCHMARK_APP = 'https://core.mojoapps.io/benchmark.mojo'
@@ -15,11 +16,11 @@ _BENCHMARK_APP = 'https://core.mojoapps.io/benchmark.mojo'
_EXTRA_TIMEOUT = 20
_MEASUREMENT_RESULT_FORMAT = r"""
-^ # Beginning of the line.
-measurement: # Hard-coded tag.
-\s+(\S+) # Match measurement spec.
-\s+(\S+) # Match measurement result.
-$ # End of the line.
+^ # Beginning of the line.
+measurement: # Hard-coded tag.
+\s+(.+) # Match measurement spec.
+\s+([0-9]+(.[0-9]+)?) # Match measurement result.
+$ # End of the line.
"""
_MEASUREMENT_REGEX = re.compile(_MEASUREMENT_RESULT_FORMAT, re.VERBOSE)
@@ -85,7 +86,7 @@ def run(shell, shell_args, app, duration_seconds, measurements, verbose,
shell_args.append(_BENCHMARK_APP)
shell_args.append('--force-offline-by-default')
shell_args.append('--args-for=%s %s' % (_BENCHMARK_APP,
- ' '.join(benchmark_args)))
+ ' '.join(map(pipes.quote, benchmark_args))))
if verbose:
print 'shell arguments: ' + str(shell_args)
« no previous file with comments | « apps/benchmark/run_args.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698