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: 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.py ('k') | tools/android/loading/sandwich_task_builder.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 f8ca187885b416722a921e0a485e6250182bf04e..745a5841233638dae320784fe1ba5a57d37d5b5e 100644
--- a/tools/android/loading/sandwich_runner.py
+++ b/tools/android/loading/sandwich_runner.py
@@ -250,3 +250,24 @@ class SandwichRunner(object):
self._PullCacheFromDevice()
self._chrome_ctl = None
+
+
+def IterRepeatedRuns(runner_output_dir):
pasko 2016/05/31 13:00:33 naming: this is a generator, so let's call it: Ge
gabadie 2016/05/31 14:33:01 WalkRepeatedRuns as agreed offline.
+ """Yields repeat_id, repeat_dir.
pasko 2016/05/31 13:00:33 Let's add "Not ordered."
pasko 2016/05/31 13:00:33 s/repeat_dir/repeat_directory/
gabadie 2016/05/31 14:33:01 Line are not very wide and git -C tools/android/lo
gabadie 2016/05/31 14:33:02 Done.
pasko 2016/05/31 16:00:00 LOL, this was about the comment that fits into the
gabadie 2016/06/01 12:04:33 Oh my bad, I have not seen that this comment was a
+
+ 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, ('Looks like \'{}\' was not a sandwich runner '
pasko 2016/05/31 13:00:33 nit: I prefer error messages to mention the import
gabadie 2016/05/31 14:33:01 Done.
+ 'output directory.').format(output_directory_path)
« no previous file with comments | « tools/android/loading/sandwich_metrics.py ('k') | tools/android/loading/sandwich_task_builder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698