Merge "Profiler: don't call trace_cls if profiler is not enabled"

This commit is contained in:
Jenkins 2016-02-15 23:52:05 +00:00 committed by Gerrit Code Review
commit 7b428a9aac
2 changed files with 4 additions and 2 deletions

View File

@ -125,7 +125,8 @@ class Service(service.Service):
self.topic = topic
self.manager_class_name = manager
manager_class = importutils.import_class(self.manager_class_name)
manager_class = profiler.trace_cls("rpc")(manager_class)
if CONF.profiler.profiler_enabled:
manager_class = profiler.trace_cls("rpc")(manager_class)
self.manager = manager_class(host=self.host,
service_name=service_name,

View File

@ -247,7 +247,8 @@ class VolumeManager(manager.SchedulerDependentManager):
host=self.host,
is_vol_db_empty=vol_db_empty)
self.driver = profiler.trace_cls("driver")(self.driver)
if CONF.profiler.profiler_enabled:
self.driver = profiler.trace_cls("driver")(self.driver)
try:
self.extra_capabilities = jsonutils.loads(
self.driver.configuration.extra_capabilities)