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

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: Addresses Egor's comments 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 for repeat_id in xrange(self.repeat): 247 for repeat_id in xrange(self.repeat):
248 self._RunUrl(run_id=repeat_id) 248 self._RunUrl(run_id=repeat_id)
249 finally: 249 finally:
250 if self._local_cache_directory_path: 250 if self._local_cache_directory_path:
251 shutil.rmtree(self._local_cache_directory_path) 251 shutil.rmtree(self._local_cache_directory_path)
252 self._local_cache_directory_path = None 252 self._local_cache_directory_path = None
253 if self.cache_operation == CacheOperation.SAVE: 253 if self.cache_operation == CacheOperation.SAVE:
254 self._PullCacheFromDevice() 254 self._PullCacheFromDevice()
255 255
256 self._chrome_ctl = None 256 self._chrome_ctl = None
257
258
259 def WalkRepeatedRuns(runner_output_dir):
260 """Yields unordered (repeat id, path of the repeat directory).
pasko 2016/06/01 13:09:22 nice, thank you
261
262 Args:
263 runner_output_dir: Same as for SandwichRunner.output_dir.
264 """
265 repeated_run_count = 0
266 for node_name in os.listdir(runner_output_dir):
267 repeat_dir = os.path.join(runner_output_dir, node_name)
268 if not os.path.isdir(repeat_dir):
269 continue
270 try:
271 repeat_id = int(node_name)
272 except ValueError:
273 continue
274 yield repeat_id, repeat_dir
275 repeated_run_count += 1
276 assert repeated_run_count > 0, ('Error: not a sandwich runner output '
277 'directory: {}').format(runner_output_dir)
OLDNEW
« 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