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

Unified Diff: tracing/bin/compare_samples

Issue 2089833002: Entry point for bisect sample comparison. (Closed) Base URL: https://github.com/catapult-project/catapult.git@mann
Patch Set: Closing low level file handle for temp file. Created 4 years, 2 months 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
« no previous file with comments | « no previous file | tracing/tracing/base/statistics.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/bin/compare_samples
diff --git a/tracing/bin/compare_samples b/tracing/bin/compare_samples
new file mode 100755
index 0000000000000000000000000000000000000000..72b79f9441292f5008818cf243d3dc4fcc18eea3
--- /dev/null
+++ b/tracing/bin/compare_samples
@@ -0,0 +1,53 @@
+#!/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 os
+import sys
+
+tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
+ '..'))
+sys.path.append(tracing_path)
+from tracing.metrics import compare_samples
+
+def Main(argv):
+ parser = argparse.ArgumentParser(
+ description='Compare samples.')
+ parser.add_argument('sample_a', type=str,
+ help='comma-separated list of paths to valuesets from '
+ 'sample a')
+ parser.add_argument('sample_b', type=str,
+ help='comma-separated list of paths to valuesets from '
+ 'sample b')
+ parser.add_argument('metric', type=str,
+ help='name of the metric to compare')
+ parser.add_argument('--chartjson', dest='format', action='store_const',
+ const='chartjson',
+ help='assume chartjson format for the input data')
+ parser.add_argument('--buildbot', dest='format', action='store_const',
+ const='buildbot',
+ help='assume buildbot result line format for the data')
+ parser.add_argument('--valueset', dest='format', action='store_const',
+ const='valueset',
+ help='assume valueset format for the input data')
+ args = parser.parse_args(argv[1:])
+
+ if not args.format:
+ filename = os.path.basename(sample_a.split(',')[0])
+ if filename == 'results-valueset.json':
+ args.format = 'valueset'
+ else:
+ args.format = 'chartjson'
+
+ vinn_result = compare_samples.CompareSamples(
+ args.sample_a,
+ args.sample_b,
+ args.metric,
+ args.format
+ )
+ print vinn_result.stdout
+ return vinn_result.returncode
+
+if __name__ == '__main__':
+ sys.exit(Main(sys.argv))
« no previous file with comments | « no previous file | tracing/tracing/base/statistics.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698