зеркало из https://github.com/mozilla/gecko-dev.git
648ccad85b
Allows mach commands to define their own glean metrics with the `metrics_path` @CommandProvider parameter. When `metrics_path` is defined: * A `metrics` kwarg is provided to the decorated class. This `metrics` handle is a Glean instance, so Glean documentation should be consulted for usage information. * When `mach doc telemetry` is run, metrics docs will be generated from all the registered metrics files. Note: there was some consideration between making `metrics_path` a @CommandProvider or @Command parameter. In the end, @CommandProvider seemed like a better fit because: * Metrics seem to be more associated with the entire class than a specific command/method. This is because a class represents a "domain", and that domain may have different commands that have overlapping metrics. Accordingly, all the metrics should be defined once as available to the entire class. * Currently, @Command methods only take parameters that map one-to-one with CLI arguments. It could seem inconsistent to have one exception: the metrics handle Differential Revision: https://phabricator.services.mozilla.com/D85953 |
||
---|---|---|
.. | ||
docs | ||
mach | ||
README.rst | ||
bash-completion.sh | ||
metrics.yaml | ||
pings.yaml | ||
setup.cfg | ||
setup.py |
README.rst
==== mach ==== Mach (German for *do*) is a generic command dispatcher for the command line. To use mach, you install the mach core (a Python package), create an executable *driver* script (named whatever you want), and write mach commands. When the *driver* is executed, mach dispatches to the requested command handler automatically. To learn more, read the docs in ``docs/``.