Chromium Code Reviews| Index: tracing/bin/chartjson2histograms |
| diff --git a/tracing/bin/chartjson2histograms b/tracing/bin/chartjson2histograms |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..96d1650f89031e7ce534c8f2289f4de6f9ed8520 |
| --- /dev/null |
| +++ b/tracing/bin/chartjson2histograms |
| @@ -0,0 +1,34 @@ |
| +#!/usr/bin/env python |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import argparse |
| +import os |
| +import sys |
| + |
| +tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__), |
| + '..')) |
| +sys.path.append(tracing_path) |
| +from tracing.value import convert_chart_json |
| + |
| + |
| +def Main(argv): |
| + parser = argparse.ArgumentParser( |
| + description='Compare samples.') |
| + parser.add_argument('chart_json', type=str, help='(input)') |
| + parser.add_argument('histogram_json', type=str, help='(input/output)') |
| + args = parser.parse_args(argv[1:]) |
| + |
| + vinn_result = convert_chart_json.ConvertChartJson(args.chart_json) |
| + |
| + if vinn_result.returncode == 0: |
| + histograms = json.loads(vinn_result.stdout) |
| + if os.path.exists(args.histogram_json): |
| + 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
|
| + json.dump(histograms, file(args.histogram_json, 'w')) |
| + |
| + return vinn_result.returncode |
| + |
| +if __name__ == '__main__': |
| + sys.exit(Main(sys.argv)) |