Merge "Minor updates to metrics documentation"

This commit is contained in:
Jenkins 2016-08-15 23:55:01 +00:00 committed by Gerrit Code Review
commit d34bc0559c

View File

@ -26,18 +26,18 @@ ironic-lib every time. For example::
from ironic_lib import metrics_utils from ironic_lib import metrics_utils
def my_method(): def my_method():
with metrics_utils.get_metrics_logger(__name__).timer(): with metrics_utils.get_metrics_logger(__name__).timer('my_method'):
return _do_work() return _do_work()
As a note, these metric collectors do work for custom HardwareManagers as As a note, these metric collectors do work for custom HardwareManagers as
well, however, you may want to metric the portions of a method that determine well. However, you may want to metric the portions of a method that determine
compatability separate from portions of a method that actually do work, in compatibility separate from portions of a method that actually do work, in
order to assure the metrics are relevant and useful on all hardware. order to assure the metrics are relevant and useful on all hardware.
Explicitly sending metrics Explicitly sending metrics
========================== ==========================
A feature that may be particularly helpful for deployers writing custom A feature that may be particularly helpful for deployers writing custom
HardwareManagers is the ability to explicitly send metrics. As an example, HardwareManagers is the ability to explicitly send metrics. For instance,
you could add a cleaning step which would retrieve metrics about a device and you could add a cleaning step which would retrieve metrics about a device and
ship them using the provided metrics library. For example:: ship them using the provided metrics library. For example::