Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/env python | |
| 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 | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 import argparse | |
| 7 import os | |
| 8 import sys | |
| 9 | |
| 10 tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__), | |
| 11 '..')) | |
| 12 sys.path.append(tracing_path) | |
| 13 from tracing.value import convert_chart_json | |
| 14 | |
| 15 | |
| 16 def Main(argv): | |
| 17 parser = argparse.ArgumentParser( | |
| 18 description='Compare samples.') | |
| 19 parser.add_argument('chart_json', type=str, help='(input)') | |
| 20 parser.add_argument('histogram_json', type=str, help='(input/output)') | |
| 21 args = parser.parse_args(argv[1:]) | |
| 22 | |
| 23 vinn_result = convert_chart_json.ConvertChartJson(args.chart_json) | |
| 24 | |
| 25 if vinn_result.returncode == 0: | |
| 26 histograms = json.loads(vinn_result.stdout) | |
| 27 if os.path.exists(args.histogram_json): | |
| 28 histograms.extend(json.load(file(args.histogram_json, 'r'))) | |
|
nednguyen
2016/11/03 21:10:24
This could be confusing to people that if they run
benjhayden
2016/11/09 23:48:55
valueset2html reads existing results from the outp
| |
| 29 json.dump(histograms, file(args.histogram_json, 'w')) | |
| 30 | |
| 31 return vinn_result.returncode | |
| 32 | |
| 33 if __name__ == '__main__': | |
| 34 sys.exit(Main(sys.argv)) | |
| OLD | NEW |