Mention OsProfiler in the testing doc

Since I5a0e805fe04c00c5e7cf316f0ea8d432b940e560 OsProfiler can be used
with extracted placement service to trace the wsgi endpoint. This patch
adds documentations to help using the OsProfiler.

Story: 2005842
Task: 34191
Change-Id: I33a4f529660057e00e6da25fa4fb4263854819d1
This commit is contained in:
Balazs Gibizer 2019-06-26 14:37:36 +02:00 committed by Matt Riedemann
parent 435aa8dbe7
commit 243757dde6
1 changed files with 34 additions and 0 deletions

View File

@ -136,6 +136,39 @@ The profiling results will be in the directory named by ``OS_WSGI_PROFILER``.
There are many ways to analyze the files. See `Profiling WSGI Apps`_ for an
example.
Profiling with OSProfiler
-------------------------
To use `OSProfiler`_ with placement:
* Add a [profiler] section to the placement.conf:
.. code-block:: ini
[profiler]
connection_string = mysql+pymysql://root:admin@127.0.0.1/osprofiler?charset=utf8
hmac_keys = my-secret-key
enabled = True
* Include the hmac_keys in your API request:
.. code-block:: console
$ openstack resource provider list --os-profile my-secret-key
The openstack client will return the trace id:
.. code-block:: console
Trace ID: 67428cdd-bfaa-496f-b430-507165729246
* Extract the trace in html format:
.. code-block:: console
$ osprofiler trace show --html 67428cdd-bfaa-496f-b430-507165729246 \
--connection-string mysql+pymysql://root:admin@127.0.0.1/osprofiler?charset=utf8
.. _bug: https://github.com/cdent/gabbi/issues
.. _fixtures: http://gabbi.readthedocs.io/en/latest/fixtures.html
@ -148,3 +181,4 @@ example.
.. _telemetry: http://specs.openstack.org/openstack/telemetry-specs/specs/kilo/declarative-http-tests.html
.. _Werkzeug: https://palletsprojects.com/p/werkzeug/
.. _wsgi-intercept: http://wsgi-intercept.readthedocs.io/
.. _OSProfiler: https://docs.openstack.org/osprofiler/latest/