diff options
| author | Josh Gachnang <josh@pcsforeducation.com> | 2014-09-08 20:26:51 -0700 |
|---|---|---|
| committer | Jay Faulkner <jay@jvf.cc> | 2016-08-03 11:24:54 -0700 |
| commit | fd874652e3558cc2f9a3512f0c7b4e2f4170ec22 (patch) | |
| tree | b3612e57e460469972460393aa05a1f5df00d00b /ironic_python_agent/api/controllers/root.py | |
| parent | ad60806f93c7d4cc9eec61ff24486db091ecb215 (diff) | |
| download | ironic-python-agent-fd874652e3558cc2f9a3512f0c7b4e2f4170ec22.tar.gz | |
Add metrics support to IPA
This utilizes the new metrics support in ironic-lib to allow the agent to
report timing metrics for agent API methods as configured in ironic-lib.
Additionally, this adds developer docs on how to use metrics in IPA,
including some caveats specific to ironic-lib.metrics use in IPA.
Co-Authored-By: Jay Faulkner <jay@jvf.cc>
Co-Authored-By: Alex Weeks <alex.weeks@gmail.com>
Change-Id: Ic08d4ff78b6fb614b474b956a32eac352a14262a
Partial-bug: #1526219
Diffstat (limited to 'ironic_python_agent/api/controllers/root.py')
| -rw-r--r-- | ironic_python_agent/api/controllers/root.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ironic_python_agent/api/controllers/root.py b/ironic_python_agent/api/controllers/root.py index 46caaad0..c95e2186 100644 --- a/ironic_python_agent/api/controllers/root.py +++ b/ironic_python_agent/api/controllers/root.py @@ -12,9 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from ironic_lib import metrics_utils import pecan from pecan import rest - from wsme import types as wtypes import wsmeext.pecan as wsme_pecan @@ -81,7 +81,8 @@ class RootController(rest.RestController): # NOTE: The reason why convert() it's being called for every # request is because we need to get the host url from # the request object to make the links. - return Root.convert() + with metrics_utils.get_metrics_logger(__name__).timer('get'): + return Root.convert() @pecan.expose() def _route(self, args): |
