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

Side by Side 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: A couple more changes. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8
9 tracing_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
10 '..'))
11 sys.path.append(tracing_path)
12 from tracing.metrics import compare_samples
13
14 def Main(argv):
15 parser = argparse.ArgumentParser(
16 description='Compare samples.')
17 parser.add_argument('sample_a', type=str,
18 help='comma-separated list of paths to valuesets from '
19 'sample a')
20 parser.add_argument('sample_b', type=str,
21 help='comma-separated list of paths to valuesets from '
22 'sample b')
23 parser.add_argument('metric', type=str,
24 help='name of the metric to compare')
25 parser.add_argument('--chartjson', dest='format', action='store_const',
26 const='chartjson',
27 help='assume chartjson format for the input data')
28 parser.add_argument('--valueset', dest='format', action='store_const',
RobertoCN 2016/09/01 19:28:23 Add --buildbot
RobertoCN 2016/09/02 21:19:30 Done.
29 const='valueset',
30 help='assume valueset format for the input data')
31 args = parser.parse_args(argv[1:])
32
33 if not args.format:
34 filename = os.path.basename(sample_a.split(',')[0])
35 if filename == 'results-valueset.json':
36 args.format = 'valueset'
37 else:
38 args.format = 'chartjson'
39
40 error_code, output = compare_samples.CompareSamples(
41 args.sample_a,
42 args.sample_b,
43 args.metric,
44 args.format
45 )
46 print output
47 return error_code
48
49 if __name__ == '__main__':
50 sys.exit(Main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | tracing/tracing/metrics/compare_samples.html » ('j') | tracing/tracing/metrics/compare_samples.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698