kuryr-kubernetes/kuryr_kubernetes/cmd/__init__.py
Janonymous bb46102a03 Implement Guru meditation reports
Guru Meditation report can log runtime configuration of a given process,
along with thread status and greenthread status.
It greatly helps to check the process runtime status.

The usage is simple:
kill -SIGUSR2 {process-id}

With this we can show report of kuryr-kubernetes

Change-Id: I4cb2314bd25d3200781582b1e188139751666fd3
Implements: blueprint oslo-gmr
2017-04-13 03:19:08 +00:00

29 lines
1.1 KiB
Python

# Copyright 2017 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import logging as sys_logging
from oslo_reports import guru_meditation_report as gmr
from kuryr_kubernetes import version
# During the call to gmr.TextGuruMeditation.setup_autorun(), Guru Meditation
# Report tries to start logging. Set a handler here to accommodate this.
logger = sys_logging.getLogger(None)
if not logger.handlers:
logger.addHandler(sys_logging.StreamHandler())
_version_string = version.version_info.release_string()
gmr.TextGuruMeditation.setup_autorun(version=_version_string)