Fix api index and module index

This patch fixes the index and module index for the osprofiler documentation
home page.
It also updates the documents tox environments to use a docs requirements.txt

Change-Id: I880f1c28232a299f50ea9ccc2178f1444efb9a41
This commit is contained in:
Michael Johnson 2022-02-14 18:50:55 +00:00
parent a2e5a66696
commit b9206a5349
13 changed files with 63 additions and 45 deletions

3
.gitignore vendored
View File

@ -40,6 +40,9 @@ cover
.pydevproject
.idea
# Docs generated
doc/source/contributor/modules
# reno build
releasenotes/build
RELEASENOTES.rst

7
doc/requirements.txt Normal file
View File

@ -0,0 +1,7 @@
docutils>=0.14 # OSI-Approved Open Source, Public Domain
openstackdocstheme>=2.2.1 # Apache-2.0
sphinx>=2.0.0,!=2.1.0 # BSD
sphinxcontrib-apidoc>=0.2.1 # BSD
# Build release notes
reno>=3.1.0 # Apache-2.0

View File

@ -49,6 +49,7 @@ extensions = [
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'openstackdocstheme',
'sphinxcontrib.apidoc',
]
# openstackdocstheme options
@ -130,3 +131,10 @@ texinfo_documents = [
'Miscellaneous'
),
]
apidoc_output_dir = 'contributor/modules'
apidoc_module_dir = '../../osprofiler'
apidoc_excluded_paths = [
'hacking',
'tests',
]

View File

@ -14,6 +14,12 @@ reasons (for example in isolating cross-project performance issues).
user/index
.. toctree::
:hidden:
contributor/modules/modules
.. rubric:: Indices and tables
* :ref:`genindex`

View File

@ -1,5 +1,6 @@
coverage===4.0
ddt===1.0.1
docutils==0.14
dulwich===0.15.0
elasticsearch===2.0.0
importlib_metadata==1.7.0

View File

@ -87,15 +87,12 @@ class Driver(object):
:param info: Contains information about trace element.
In payload dict there are always 3 ids:
"base_id" - uuid that is common for all notifications
related to one trace. Used to simplify
retrieving of all trace elements from
the backend.
related to one trace. Used to simplify retrieving of all
trace elements from the backend.
"parent_id" - uuid of parent element in trace
"trace_id" - uuid of current element in trace
With parent_id and trace_id it's quite simple to build
tree of trace elements, which simplify analyze of trace.
"""
raise NotImplementedError("{0}: This method is either not supported "
"or has to be overridden".format(
@ -120,7 +117,7 @@ class Driver(object):
:param fields: Set of trace fields to return. Defaults to 'base_id'
and 'timestamp'
:return List of traces, where each trace is a dictionary containing
:returns: List of traces, where each trace is a dictionary containing
at least `base_id` and `timestamp`.
"""
raise NotImplementedError("{0}: This method is either not supported "

View File

@ -58,15 +58,12 @@ class ElasticsearchDriver(base.Driver):
:param info: Contains information about trace element.
In payload dict there are always 3 ids:
"base_id" - uuid that is common for all notifications
related to one trace. Used to simplify
retrieving of all trace elements from
Elasticsearch.
related to one trace. Used to simplify retrieving of all
trace elements from Elasticsearch.
"parent_id" - uuid of parent element in trace
"trace_id" - uuid of current element in trace
With parent_id and trace_id it's quite simple to build
tree of trace elements, which simplify analyze of trace.
"""
info = info.copy()
@ -112,7 +109,7 @@ class ElasticsearchDriver(base.Driver):
:param fields: Set of trace fields to return. Defaults to 'base_id'
and 'timestamp'
:return List of traces, where each trace is a dictionary containing
:returns: List of traces, where each trace is a dictionary containing
at least `base_id` and `timestamp`.
"""
query = {"match_all": {}}

View File

@ -44,8 +44,7 @@ class LogInsightDriver(base.Driver):
If the username or password contains the character ':' or '@', it must be
escaped using URL encoding. For example, the connection string to connect
to Log Insight server at 10.1.2.3 using username "osprofiler" and password
"p@ssword" is:
loginsight://osprofiler:p%40ssword@10.1.2.3
"p@ssword" is: loginsight://osprofiler:p%40ssword@10.1.2.3
"""
def __init__(
self, connection_str, project=None, service=None, host=None,

View File

@ -86,7 +86,6 @@ class Messaging(base.Driver):
related to one trace.
"parent_id" - uuid of parent element in trace
"trace_id" - uuid of current element in trace
With parent_id and trace_id it's quite simple to build
tree of trace elements, which simplify analyze of trace.

View File

@ -45,15 +45,12 @@ class MongoDB(base.Driver):
:param info: Contains information about trace element.
In payload dict there are always 3 ids:
"base_id" - uuid that is common for all notifications
related to one trace. Used to simplify
retrieving of all trace elements from
MongoDB.
related to one trace. Used to simplify retrieving of all
trace elements from MongoDB.
"parent_id" - uuid of parent element in trace
"trace_id" - uuid of current element in trace
With parent_id and trace_id it's quite simple to build
tree of trace elements, which simplify analyze of trace.
"""
data = info.copy()
data["project"] = self.project
@ -77,7 +74,7 @@ class MongoDB(base.Driver):
:param fields: Set of trace fields to return. Defaults to 'base_id'
and 'timestamp'
:return List of traces, where each trace is a dictionary containing
:returns: List of traces, where each trace is a dictionary containing
at least `base_id` and `timestamp`.
"""
fields = set(fields or self.default_trace_fields)

View File

@ -61,15 +61,12 @@ class Redis(base.Driver):
:param info: Contains information about trace element.
In payload dict there are always 3 ids:
"base_id" - uuid that is common for all notifications
related to one trace. Used to simplify
retrieving of all trace elements from
Redis.
related to one trace. Used to simplify retrieving of all
trace elements from Redis.
"parent_id" - uuid of parent element in trace
"trace_id" - uuid of current element in trace
With parent_id and trace_id it's quite simple to build
tree of trace elements, which simplify analyze of trace.
"""
data = info.copy()
data["project"] = self.project
@ -95,7 +92,7 @@ class Redis(base.Driver):
:param fields: Set of trace fields to return. Defaults to 'base_id'
and 'timestamp'
:return List of traces, where each trace is a dictionary containing
:returns: List of traces, where each trace is a dictionary containing
at least `base_id` and `timestamp`.
"""
fields = set(fields or self.default_trace_fields)

View File

@ -5,9 +5,7 @@ coverage>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT
stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
openstackdocstheme>=2.2.1 # Apache-2.0
sphinx>=2.0.0,!=2.1.0 # BSD
docutils>=0.14 # OSI-Approved Open Source, Public Domain
# Bandit security code scanner
bandit>=1.6.0,<1.7.0 # Apache-2.0
@ -20,9 +18,6 @@ elasticsearch>=2.0.0,<3.0.0 # Apache-2.0
# Redis python client
redis>=2.10.0 # MIT
# Build release notes
reno>=3.1.0 # Apache-2.0
# For Jaeger Tracing
jaeger-client>=3.8.0 # Apache-2.0

16
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
minversion = 3.1.0
minversion = 3.18.0
# Needed to create ChangeLog for docs building
skipsdist = False
envlist = py3,pep8
@ -52,7 +52,13 @@ commands =
coverage xml -o cover/coverage.xml
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
allowlist_externals = rm
commands =
rm -rf doc/build api-guide/build api-ref/build doc/source/contributor/modules
sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:bandit]
@ -83,7 +89,13 @@ extension =
paths = ./osprofiler/hacking
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
allowlist_externals = rm
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:lower-constraints]
deps =