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

Unified Diff: infra/tools/metric_tool/__main__.py

Issue 1368583005: Create metric_tool to deal with metric definitions (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 5 years, 3 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 | « infra/tools/metric_tool/__init__.py ('k') | infra/tools/metric_tool/metric_tool.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/tools/metric_tool/__main__.py
diff --git a/infra/tools/metric_tool/__main__.py b/infra/tools/metric_tool/__main__.py
new file mode 100644
index 0000000000000000000000000000000000000000..2d514542c0199ed5ab684075a44d4ac6a3572c5f
--- /dev/null
+++ b/infra/tools/metric_tool/__main__.py
@@ -0,0 +1,37 @@
+# Copyright 2015 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.
+"""Utilities to deal with metrics.
+
+Extracting all metrics in a set of Python files:
+./run.py infra.tools.metric_tool extract
+"""
+# This file is untested, keep as little code as possible in there.
+
+import logging
+import sys
+
+from infra.tools.metric_tool import metric_tool
+import infra_libs
+
+
+# https://chromium.googlesource.com/infra/infra/+/master/infra_libs/logs/README.md
+LOGGER = logging.getLogger(__name__)
+
+
+class Metric_tool(infra_libs.BaseApplication):
+ DESCRIPTION = sys.modules['__main__'].__doc__
+ PROG_NAME = 'metric_tool'
+
+ def add_argparse_options(self, parser):
+ super(Metric_tool, self).add_argparse_options(parser)
+ parser.add_argument('path', type=str,
+ help='Directory to recursively scan for Python files.')
+
+ def main(self, opts):
+ # Do more processing here
+ metric_tool.main(opts.path)
+
+
+if __name__ == '__main__':
+ Metric_tool().run()
« no previous file with comments | « infra/tools/metric_tool/__init__.py ('k') | infra/tools/metric_tool/metric_tool.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698