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

Unified Diff: tools/android/loading/sandwich_runner.py

Issue 2009883002: sandwich: Make metrics extraction more customizable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/ADDITIONAL_COLUMN_NAMES/additional_column_names/g Created 4 years, 7 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 | « tools/android/loading/sandwich_metrics_unittest.py ('k') | tools/android/loading/sandwich_swr.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/sandwich_runner.py
diff --git a/tools/android/loading/sandwich_runner.py b/tools/android/loading/sandwich_runner.py
index fb48b7cb0144d014b9fcbb47942cdcbf52289c6a..9ed8258f63ecbc827a404831d7ccfafe14b7ad3b 100644
--- a/tools/android/loading/sandwich_runner.py
+++ b/tools/android/loading/sandwich_runner.py
@@ -254,3 +254,24 @@ class SandwichRunner(object):
self._PullCacheFromDevice()
self._chrome_ctl = None
+
+
+def WalkRepeatedRuns(runner_output_dir):
+ """Yields unordered (repeat id, path of the repeat directory).
+
+ Args:
+ runner_output_dir: Same as for SandwichRunner.output_dir.
+ """
+ repeated_run_count = 0
+ for node_name in os.listdir(runner_output_dir):
+ repeat_dir = os.path.join(runner_output_dir, node_name)
+ if not os.path.isdir(repeat_dir):
+ continue
+ try:
+ repeat_id = int(node_name)
+ except ValueError:
+ continue
+ yield repeat_id, repeat_dir
+ repeated_run_count += 1
+ assert repeated_run_count > 0, ('Error: not a sandwich runner output '
+ 'directory: {}').format(runner_output_dir)
« no previous file with comments | « tools/android/loading/sandwich_metrics_unittest.py ('k') | tools/android/loading/sandwich_swr.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698