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

Unified Diff: tracing/bin/chartjson2histograms

Issue 2474573002: Convert chart-json to Histograms. (Closed)
Patch Set: . Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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))

Powered by Google App Engine
This is Rietveld 408576698