keystone  18.0.0
About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Victoria" series (maintained release).
  Fossies Dox: keystone-18.0.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

profiler.py
Go to the documentation of this file.
1 # Licensed under the Apache License, Version 2.0 (the "License"); you may
2 # not use this file except in compliance with the License. You may obtain
3 # a copy of the License at
4 #
5 # http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 # License for the specific language governing permissions and limitations
11 # under the License.
12 
13 from oslo_log import log
14 import osprofiler.initializer
15 
16 import keystone.conf
17 
18 
19 CONF = keystone.conf.CONF
20 LOG = log.getLogger(__name__)
21 
22 
23 def setup(name, host='0.0.0.0'): # nosec
24  """Setup OSprofiler notifier and enable profiling.
25 
26  :param name: name of the service that will be profiled
27  :param host: hostname or host IP address that the service will be
28  running on. By default host will be set to 0.0.0.0, but more
29  specified host name / address usage is highly recommended.
30  """
31  if CONF.profiler.enabled:
32  osprofiler.initializer.init_from_conf(
33  conf=CONF,
34  context={},
35  project="keystone",
36  service=name,
37  host=host
38  )
39  LOG.info("OSProfiler is enabled.\n"
40  "Traces provided from the profiler "
41  "can only be subscribed to using the same HMAC keys that "
42  "are configured in Keystone's configuration file "
43  "under the [profiler] section. \n To disable OSprofiler "
44  "set in /etc/keystone/keystone.conf:\n"
45  "[profiler]\n"
46  "enabled=false")
keystone.common.profiler.setup
def setup(name, host='0.0.0.0')
Definition: profiler.py:23
keystone.conf
Definition: __init__.py:1