Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 """Utilities to deal with metrics. | |
| 5 | |
| 6 Extracting all metrics in a set of Python files: | |
| 7 ./run.py infra.tools.metric_tool extract | |
| 8 """ | |
| 9 # This file is untested, keep as little code as possible in there. | |
|
Sergey Berezin
2015/09/29 00:01:18
Consider adding a smoke test just to make sure the
| |
| 10 | |
| 11 import logging | |
| 12 import sys | |
| 13 | |
| 14 from infra.tools.metric_tool import metric_tool | |
| 15 import infra_libs | |
| 16 | |
| 17 | |
| 18 # https://chromium.googlesource.com/infra/infra/+/master/infra_libs/logs/README. md | |
| 19 LOGGER = logging.getLogger(__name__) | |
| 20 | |
| 21 | |
| 22 class Metric_tool(infra_libs.BaseApplication): | |
| 23 DESCRIPTION = sys.modules['__main__'].__doc__ | |
| 24 PROG_NAME = 'metric_tool' | |
| 25 | |
| 26 def add_argparse_options(self, parser): | |
| 27 super(Metric_tool, self).add_argparse_options(parser) | |
| 28 parser.add_argument('path', type=str, | |
| 29 help='Directory to recursively scan for Python files.') | |
| 30 | |
| 31 def main(self, opts): | |
| 32 # Do more processing here | |
| 33 metric_tool.main(opts.path) | |
| 34 | |
| 35 | |
| 36 if __name__ == '__main__': | |
| 37 Metric_tool().run() | |
| OLD | NEW |