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

Side by Side Diff: tracing/bin/valueset2html

Issue 2749533003: [Telemetry] Remove URL from TelemetryInfo. (Closed)
Patch Set: [Telemetry] Remove URL from TelemetryInfo. Created 3 years, 9 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import codecs 7 import codecs
8 import json 8 import json
9 import sys 9 import sys
10 import os 10 import os
(...skipping 25 matching lines...) Expand all
36 for html_path in args.html: 36 for html_path in args.html:
37 histograms.extend(results_renderer.ReadExistingResults( 37 histograms.extend(results_renderer.ReadExistingResults(
38 open(html_path, 'r').read())) 38 open(html_path, 'r').read()))
39 39
40 for json_path in args.json: 40 for json_path in args.json:
41 histograms.extend(json.load(open(json_path, 'r'))) 41 histograms.extend(json.load(open(json_path, 'r')))
42 42
43 for json_path in args.mapresults: 43 for json_path in args.mapresults:
44 for filename, results in json.load(open(json_path, 'r')).iteritems(): 44 for filename, results in json.load(open(json_path, 'r')).iteritems():
45 for histogram in results['pairs']['histograms']: 45 for histogram in results['pairs']['histograms']:
46 histogram['diagnostics']['iteration']['storyUrl'] = filename
47 histograms.append(histogram) 46 histograms.append(histogram)
48 47
49 open(args.html_path, 'a').close() # Create file if it doesn't exist. 48 open(args.html_path, 'a').close() # Create file if it doesn't exist.
50 with codecs.open(args.html_path, 49 with codecs.open(args.html_path,
51 mode='r+', encoding='utf-8') as output_stream: 50 mode='r+', encoding='utf-8') as output_stream:
52 results_renderer.RenderHTMLView(histograms, output_stream) 51 results_renderer.RenderHTMLView(histograms, output_stream)
53 52
54 if __name__ == '__main__': 53 if __name__ == '__main__':
55 sys.exit(main()) 54 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698