From 5f146d465d233ce48b537f6e5a544fce380a85cb Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 11 Aug 2016 07:24:06 -0400 Subject: [PATCH] Make code blocks real code blocks in metrics docs Makes them an RST block quote and 4 space indents instead of 2. Change-Id: If2b727ac431e70d714f3df0c622c5516901f3393 --- doc/source/metrics.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/metrics.rst b/doc/source/metrics.rst index 8d9cd3ae2..baade79f4 100644 --- a/doc/source/metrics.rst +++ b/doc/source/metrics.rst @@ -21,13 +21,13 @@ Using a context manager Using the context manager is the recommended way for sending metrics that time or count sections of code. However, given that you cannot cache the MetricsLogger, you have to explicitly call get_metrics_logger() from -ironic-lib every time. For example: +ironic-lib every time. For example:: from ironic_lib import metrics_utils def my_method(): - with metrics_utils.get_metrics_logger(__name__).timer(): - return _do_work() + with metrics_utils.get_metrics_logger(__name__).timer(): + return _do_work() 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 @@ -39,13 +39,13 @@ Explicitly sending metrics A feature that may be particularly helpful for deployers writing custom HardwareManagers is the ability to explicitly send metrics. As an example, 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:: from ironic_lib import metrics_utils def my_cleaning_step(): - for name, value in _get_smart_data(): - metrics_utils.get_metrics_logger(__name__).send_gauge(name, value) + for name, value in _get_smart_data(): + metrics_utils.get_metrics_logger(__name__).send_gauge(name, value) References ==========