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

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

Issue 1923823003: clovis: Don't pretty-print JSON traces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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/loading_trace.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/analyze.py
diff --git a/tools/android/loading/analyze.py b/tools/android/loading/analyze.py
index db0106f036b5c334667c1ffab837bdcd2a3a89d9..82cc0718fdca0f5b64a399355afb2447dda5cf4d 100755
--- a/tools/android/loading/analyze.py
+++ b/tools/android/loading/analyze.py
@@ -59,16 +59,6 @@ def _LoadPage(device, url):
device.StartActivity(load_intent, blocking=True)
-def _WriteJson(output, json_data):
- """Write JSON data in a nice way.
-
- Args:
- output: a file object
- json_data: JSON data as a dict.
- """
- json.dump(json_data, output, sort_keys=True, indent=2)
-
-
def _GetPrefetchHtml(graph_view, name=None):
"""Generate prefetch page for the resources in resource graph.
@@ -154,14 +144,14 @@ def _FullFetch(url, json_output, prefetch):
logging.warning('Warm fetch')
warm_data = _LogRequests(url, clear_cache_override=False)
with open(json_output, 'w') as f:
- _WriteJson(f, warm_data)
+ json.dump(warm_data, f)
logging.warning('Wrote ' + json_output)
with open(json_output + '.cold', 'w') as f:
- _WriteJson(f, cold_data)
+ json.dump(cold_data, f)
logging.warning('Wrote ' + json_output + '.cold')
else:
with open(json_output, 'w') as f:
- _WriteJson(f, cold_data)
+ json.dump(cold_data, f)
logging.warning('Wrote ' + json_output)
« no previous file with comments | « no previous file | tools/android/loading/loading_trace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698