Skip to content

Commit

Permalink
Merge "Disable osprofiler by default"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Nov 28, 2014
2 parents a006d67 + 090cb56 commit f82574f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions etc/glance-api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ revocation_cache_time = 10

[profiler]
# If False fully disable profiling feature.
#enabled = True
#enabled = False

# If False doesn't trace SQL requests.
#trace_sqlalchemy = True
#trace_sqlalchemy = False

[task]
# ================= Glance Tasks Options ============================
Expand Down
4 changes: 2 additions & 2 deletions etc/glance-registry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ admin_password = %SERVICE_PASSWORD%

[profiler]
# If False fully disable profiling feature.
#enabled = True
#enabled = False

# If False doesn't trace SQL requests.
#trace_sqlalchemy = True
#trace_sqlalchemy = False
4 changes: 2 additions & 2 deletions glance/common/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@
]

profiler_opts = [
cfg.BoolOpt("enabled", default=True,
cfg.BoolOpt("enabled", default=False,
help=_('If False fully disable profiling feature.')),
cfg.BoolOpt("trace_sqlalchemy", default=True,
cfg.BoolOpt("trace_sqlalchemy", default=False,
help=_("If False doesn't trace SQL requests."))
]

Expand Down
12 changes: 12 additions & 0 deletions glance/tests/unit/common/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@ def test_load_paste_app_with_paste_config_file(self):

def test_get_path_non_exist(self):
self.assertRaises(RuntimeError, config._get_deployment_config_file)


class TestDefaultConfig(test_utils.BaseTestCase):

def setUp(self):
super(TestDefaultConfig, self).setUp()
self.CONF = config.cfg.CONF
self.CONF.import_group('profiler', 'glance.common.wsgi')

def test_osprofiler_disabled(self):
self.assertFalse(self.CONF.profiler.enabled)
self.assertFalse(self.CONF.profiler.trace_sqlalchemy)

0 comments on commit f82574f

Please sign in to comment.