Index: tracing/tracing/value/histograms_to_csv.py |
diff --git a/tracing/tracing/value/histograms_to_csv.py b/tracing/tracing/value/histograms_to_csv.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ce1b90f55b10ba5f53837ddd19ac98f93834e9be |
--- /dev/null |
+++ b/tracing/tracing/value/histograms_to_csv.py |
@@ -0,0 +1,22 @@ |
+# Copyright 2017 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 vinn |
+import tracing_project |
+ |
+def HistogramsToCsv(json_path): |
+ """Convert HistogramSet JSON to CSV. |
+ |
+ Args: |
+ json_path: path to a file containing HistogramSet JSON |
+ |
+ Returns: |
+ a Vinn result object whose 'returncode' indicates whether there was an |
+ exception, and whose 'stdout' contains CSV. |
+ """ |
+ return vinn.RunFile( |
+ os.path.join(os.path.dirname(__file__), 'histograms_to_csv_cmdline.html'), |
+ source_paths=list(tracing_project.TracingProject().source_paths), |
+ js_args=[os.path.abspath(json_path)]) |