Chromium Code Reviews| Index: tracing/bin/run_metric |
| diff --git a/tracing/bin/run_metric b/tracing/bin/run_metric |
| index 91a0eb35fb8cc0bdf1c94b0b24e8072a611e3504..fcb806c46a312d8b393f0a98224f4990c2e0a23d 100755 |
| --- a/tracing/bin/run_metric |
| +++ b/tracing/bin/run_metric |
| @@ -17,16 +17,18 @@ def Main(argv): |
| ['/tracing/metrics/all_metrics.html']) |
| parser = argparse.ArgumentParser( |
| description='Runs metrics on local traces') |
| - parser.add_argument('metric_name', |
| - help=('The function name of a registered metric, NOT ' |
| - 'filename. Available metrics are: %s' % |
| + parser.add_argument('metric', action='append', dest='metric_names', |
| + default=[], |
| + help=('Comma separated list of function names ' |
| + 'of registered metrics (not filenames.) ' |
|
petrcermak
2016/07/06 08:19:47
nit: Lines 23-25 should be vertically aligned with
|
| + 'Available metrics are: %s' % |
| ', '.join(all_metrics)), |
| choices=all_metrics, metavar='metricName') |
| parser.add_argument('trace_file_or_dir', |
| help='A trace file, or a dir containing trace files') |
| args = parser.parse_args(argv[1:]) |
| - metric = args.metric_name |
| + metrics = args.metric_names.split(',') |
| if os.path.isdir(args.trace_file_or_dir): |
| trace_dir = args.trace_file_or_dir |
| @@ -35,7 +37,7 @@ def Main(argv): |
| traces = [args.trace_file_or_dir] |
| results = {k: v.AsDict() |
| - for k, v in metric_runner.RunMetricOnTraces(traces, metric).iteritems()} |
| + for k, v in metric_runner.RunMetricOnTraces(traces, metrics).iteritems()} |
|
petrcermak
2016/07/06 08:19:47
nit: I think that "for" should be vertically align
|
| failures = [] |
| for trace in traces: |