Enable OSProfiler support in Ironic - follow-up
Fixes nits, updates documentation and releasenotes.
This is a follow-up to commit 3773f17403
.
Change-Id: I4082bbb9f8c09eaf4569317eb1387bf9a36ef254
Partial-Bug: #1560704
This commit is contained in:
parent
6f69fe7631
commit
f7f7750baf
@ -70,6 +70,7 @@ profiler options and restart ironic services::
|
||||
[profiler]
|
||||
enabled = True
|
||||
hmac_keys = SECRET_KEY # default value used across several OpenStack projects
|
||||
trace_sqlalchemy = True
|
||||
|
||||
|
||||
In order to trace ironic using OSProfiler, use openstackclient to run
|
||||
@ -95,6 +96,10 @@ The trace results can be saved in a file with ``--out file-name`` option::
|
||||
|
||||
$ osprofiler trace show --html <trace-id> --out trace.html
|
||||
|
||||
The trace results show the time spent in ironic-api, ironic-conductor, and db
|
||||
calls. More detailed db tracing is enabled if ``trace_sqlalchemy``
|
||||
is set to true.
|
||||
|
||||
Sample Trace:
|
||||
|
||||
.. figure:: ../images/sample_trace.svg
|
||||
@ -103,6 +108,8 @@ Sample Trace:
|
||||
:alt: Sample Trace
|
||||
|
||||
|
||||
Each trace has embedded trace point details as shown below:
|
||||
|
||||
.. figure:: ../images/sample_trace_details.svg
|
||||
:width: 660px
|
||||
:align: left
|
||||
|
@ -32,16 +32,18 @@ def setup(name, host='0.0.0.0'):
|
||||
a notifier backend, which is set in
|
||||
osprofiler.initializer.init_from_conf.
|
||||
"""
|
||||
if CONF.profiler.enabled:
|
||||
admin_context = context.get_admin_context()
|
||||
initializer.init_from_conf(conf=CONF,
|
||||
context=admin_context.to_dict(),
|
||||
project="ironic",
|
||||
service=name,
|
||||
host=host)
|
||||
LOG.info("OSProfiler is enabled. Trace is generated using "
|
||||
"[profiler]/hmac_keys specified in ironic.conf. "
|
||||
"To disable, set [profiler]/enabled=false")
|
||||
if not CONF.profiler.enabled:
|
||||
return
|
||||
|
||||
admin_context = context.get_admin_context()
|
||||
initializer.init_from_conf(conf=CONF,
|
||||
context=admin_context.to_dict(),
|
||||
project="ironic",
|
||||
service=name,
|
||||
host=host)
|
||||
LOG.info("OSProfiler is enabled. Trace is generated using "
|
||||
"[profiler]/hmac_keys specified in ironic.conf. "
|
||||
"To disable, set [profiler]/enabled=false")
|
||||
|
||||
|
||||
def trace_cls(name, **kwargs):
|
||||
@ -54,7 +56,7 @@ def trace_cls(name, **kwargs):
|
||||
:param kwargs: Any other keyword args used by profiler.trace_cls
|
||||
"""
|
||||
def decorator(cls):
|
||||
if profiler and 'profiler' in CONF and CONF.profiler.enabled:
|
||||
if CONF.profiler.enabled:
|
||||
trace_decorator = profiler.trace_cls(name, kwargs)
|
||||
return trace_decorator(cls)
|
||||
return cls
|
||||
|
Loading…
Reference in New Issue
Block a user