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

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

Issue 1694253002: sandwich: Aggregates metrics per URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d05
Patch Set: Addresses matt's nit Created 4 years, 10 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 | « no previous file | tools/android/loading/pull_sandwich_metrics_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/pull_sandwich_metrics.py
diff --git a/tools/android/loading/pull_sandwich_metrics.py b/tools/android/loading/pull_sandwich_metrics.py
index 15582431ab1672c3a25ce1834d58d36e7aa938e4..df24f1c36658a6d3d8893dd7ad5dc643ff0a1abc 100755
--- a/tools/android/loading/pull_sandwich_metrics.py
+++ b/tools/android/loading/pull_sandwich_metrics.py
@@ -20,6 +20,7 @@ CATEGORIES = ['blink.user_timing', 'disabled-by-default-memory-infra']
_CSV_FIELD_NAMES = [
'id',
+ 'url',
'total_load',
'onload',
'browser_malloc_avg',
@@ -145,6 +146,10 @@ def _PullMetricsFromOutputDirectory(output_directory_path):
List of dictionaries with all _CSV_FIELD_NAMES's field set.
"""
assert os.path.isdir(output_directory_path)
+ run_infos = None
+ with open(os.path.join(output_directory_path, 'run_infos.json')) as f:
+ run_infos = json.load(f)
+ assert run_infos
metrics = []
for node_name in os.listdir(output_directory_path):
if not os.path.isdir(os.path.join(output_directory_path, node_name)):
@@ -161,6 +166,7 @@ def _PullMetricsFromOutputDirectory(output_directory_path):
trace = json.load(trace_file)
trace_metrics = _PullMetricsFromTrace(trace)
trace_metrics['id'] = page_id
+ trace_metrics['url'] = run_infos['urls'][page_id]
metrics.append(trace_metrics)
assert len(metrics) > 0, ('Looks like \'{}\' was not a sandwich ' +
'run directory.').format(output_directory_path)
« no previous file with comments | « no previous file | tools/android/loading/pull_sandwich_metrics_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698