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

Side by Side Diff: tracing/bin/valueset2html

Issue 2474573002: Convert chart-json to Histograms. (Closed)
Patch Set: test with tir label Created 4 years, 1 month 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 23 matching lines...) Expand all
34 for html_path in args.html: 34 for html_path in args.html:
35 histograms.extend(results_renderer.ReadExistingResults( 35 histograms.extend(results_renderer.ReadExistingResults(
36 open(html_path, 'r'))) 36 open(html_path, 'r')))
37 37
38 for json_path in args.json: 38 for json_path in args.json:
39 histograms.extend(json.load(open(json_path, 'r'))) 39 histograms.extend(json.load(open(json_path, 'r')))
40 40
41 open(args.html_path, 'a').close() # Create file if it doesn't exist. 41 open(args.html_path, 'a').close() # Create file if it doesn't exist.
42 with codecs.open(args.html_path, 42 with codecs.open(args.html_path,
43 mode='r+', encoding='utf-8') as output_stream: 43 mode='r+', encoding='utf-8') as output_stream:
44 results_renderer.RenderHTMLView(histograms, output_stream) 44 results_renderer.RenderHTMLView(histograms, [], output_stream)
45 45
46 if __name__ == '__main__': 46 if __name__ == '__main__':
47 sys.exit(main()) 47 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698