Chromium Code Reviews| Index: tracing/tracing/value/convert_chart_json.py |
| diff --git a/tracing/tracing/value/convert_chart_json.py b/tracing/tracing/value/convert_chart_json.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..3ca5795a77500ca8376613b15426e47c7a6a1927 |
| --- /dev/null |
| +++ b/tracing/tracing/value/convert_chart_json.py |
| @@ -0,0 +1,25 @@ |
| +#!/usr/bin/env python |
|
nednguyen
2016/11/03 21:10:24
ditto
benjhayden
2016/11/09 23:48:55
compare_samples.py?
|
| +# 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 os |
| +import tracing_project |
| +import vinn |
| + |
| + |
| +def ConvertChartJson(chart_json): |
| + """Convert chart_json to Histograms. |
| + |
| + Args: |
| + chart_json: path to a file containing chart-json |
| + |
| + Returns: |
| + a Vinn result object whose 'returncode' indicates whether there was an |
| + exception, and whose 'stdout' contains HistogramSet json. |
| + """ |
| + return vinn.RunFile( |
| + os.path.join(os.path.dirname(__file__), |
| + 'convert_chart_json_cmdline.html'), |
| + source_paths=tracing_project.TracingProject().source_paths, |
| + js_args=[os.path.abspath(chart_json)]) |