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

Side by Side Diff: experimental/chrome_speed_metrics/scripts/ct_csv_to_traces.py

Issue 3015613002: Add data processing scripts for chrome-speed-metrics
Patch Set: Created 3 years, 3 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
(Empty)
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
3 # found in the LICENSE file.
4
5 """Extracts the urls to trace files from a Cluster Telemetry csv output."""
6
7 import csv
8 import sys
9
10 def CsvToTraces(infile, outfile):
11 traces = []
12 with open(infile) as inf:
13 results = csv.DictReader(inf)
14 for r in results:
15 for t in r['trace'].split(','):
16 traces.append(t)
17
18 with open(outfile, 'w') as outf:
19 for trace in traces:
20 outf.write(trace + '\n')
21
22 def main():
23 if len(sys.argv) < 3:
24 print "Usage: {0} <input-file> <output-file>".format(sys.argv[0])
25 return
26
27 input_filename = sys.argv[1]
28 output_filename = sys.argv[2]
29 CsvToTraces(input_filename, output_filename)
30
31 if __name__ == "__main__":
32 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698