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

Side by Side 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, 6 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 unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import shutil 7 import shutil
8 import sys 8 import sys
9 import tempfile 9 import tempfile
10 10
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 for repeat_id in xrange(self.repeat): 243 for repeat_id in xrange(self.repeat):
244 self._RunUrl(run_id=repeat_id) 244 self._RunUrl(run_id=repeat_id)
245 finally: 245 finally:
246 if self._local_cache_directory_path: 246 if self._local_cache_directory_path:
247 shutil.rmtree(self._local_cache_directory_path) 247 shutil.rmtree(self._local_cache_directory_path)
248 self._local_cache_directory_path = None 248 self._local_cache_directory_path = None
249 if self.cache_operation == CacheOperation.SAVE: 249 if self.cache_operation == CacheOperation.SAVE:
250 self._PullCacheFromDevice() 250 self._PullCacheFromDevice()
251 251
252 self._chrome_ctl = None 252 self._chrome_ctl = None
253
254
255 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.
256 """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
257
258 Args:
259 runner_output_dir: Same as for SandwichRunner.output_dir.
260 """
261 repeated_run_count = 0
262 for node_name in os.listdir(runner_output_dir):
263 repeat_dir = os.path.join(runner_output_dir, node_name)
264 if not os.path.isdir(repeat_dir):
265 continue
266 try:
267 repeat_id = int(node_name)
268 except ValueError:
269 continue
270 yield repeat_id, repeat_dir
271 repeated_run_count += 1
272 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.
273 'output directory.').format(output_directory_path)
OLDNEW
« 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