Fix fetching osprofiler trace-info

Some OSProfiler drivers(redis for example) require special options.
These options should be available via oslo_config, but we need to
initialize them at first.

Also, this patch adds proper logic.

Change-Id: Ic13d39b15971df7ac06f9a6eea9d06b9d063903c
This commit is contained in:
Andrey Kurilin 2018-11-06 16:09:35 +02:00
parent 1826ab7544
commit 138e58b4c2
3 changed files with 13 additions and 4 deletions

View File

@ -37,6 +37,7 @@ Fixed
* Do not ignore ``region_name`` from environment specification while
initializing keystone client.
* Fetching OSProfiler trace-info for some drivers.
[1.3.0] - 2018-10-08
--------------------

View File

@ -14,7 +14,9 @@
import json
import os
from rally.common import logging
from rally.common import opts
from rally.common.plugin import plugin
from rally.task.processing.charts import OutputTextArea
@ -30,10 +32,9 @@ def _datetime_json_serialize(obj):
@plugin.configure(name="OSProfiler")
class OSProfilerChart(OutputTextArea):
"""osprofiler content
"""OSProfiler content
This plugin complete data of osprofiler
"""
widget = "OSProfiler"
@ -43,12 +44,18 @@ class OSProfilerChart(OutputTextArea):
from osprofiler import cmd
from osprofiler.drivers import base
from osprofiler import opts as osprofiler_opts
opts.register_opts(osprofiler_opts.list_opts())
try:
engine = base.get_driver(data["data"]["conn_str"])
except Exception:
msg = "Error while fetching OSProfiler results."
if logging.is_debug():
LOG.exception("Error while fetching OSProfiler results.")
LOG.exception(msg)
else:
LOG.error(msg)
return None
data["widget"] = "EmbedChart"

View File

@ -591,7 +591,8 @@ def check_opts_import_path(logical_line, physical_line, filename):
N342
"""
excluded_files = ["./rally_openstack/__init__.py"]
excluded_files = ["./rally_openstack/__init__.py",
"./rally_openstack/embedcharts/osprofilerchart.py"]
forbidden_methods = [".register_opts("]
if filename not in excluded_files: