Merge "Improve Glance profiling"

This commit is contained in:
Jenkins 2014-08-26 05:24:36 +00:00 committed by Gerrit Code Review
commit 0aca880658
3 changed files with 14 additions and 13 deletions

@ -1,38 +1,38 @@
# Use this pipeline for no auth or image caching - DEFAULT # Use this pipeline for no auth or image caching - DEFAULT
[pipeline:glance-api] [pipeline:glance-api]
pipeline = versionnegotiation unauthenticated-context osprofiler rootapp pipeline = versionnegotiation osprofiler unauthenticated-context rootapp
# Use this pipeline for image caching and no auth # Use this pipeline for image caching and no auth
[pipeline:glance-api-caching] [pipeline:glance-api-caching]
pipeline = versionnegotiation unauthenticated-context osprofiler cache rootapp pipeline = versionnegotiation osprofiler unauthenticated-context cache rootapp
# Use this pipeline for caching w/ management interface but no auth # Use this pipeline for caching w/ management interface but no auth
[pipeline:glance-api-cachemanagement] [pipeline:glance-api-cachemanagement]
pipeline = versionnegotiation unauthenticated-context osprofiler cache cachemanage rootapp pipeline = versionnegotiation osprofiler unauthenticated-context cache cachemanage rootapp
# Use this pipeline for keystone auth # Use this pipeline for keystone auth
[pipeline:glance-api-keystone] [pipeline:glance-api-keystone]
pipeline = versionnegotiation authtoken context osprofiler rootapp pipeline = versionnegotiation osprofiler authtoken context rootapp
# Use this pipeline for keystone auth with image caching # Use this pipeline for keystone auth with image caching
[pipeline:glance-api-keystone+caching] [pipeline:glance-api-keystone+caching]
pipeline = versionnegotiation authtoken context osprofiler cache rootapp pipeline = versionnegotiation osprofiler authtoken context cache rootapp
# Use this pipeline for keystone auth with caching and cache management # Use this pipeline for keystone auth with caching and cache management
[pipeline:glance-api-keystone+cachemanagement] [pipeline:glance-api-keystone+cachemanagement]
pipeline = versionnegotiation authtoken context osprofiler cache cachemanage rootapp pipeline = versionnegotiation osprofiler authtoken context cache cachemanage rootapp
# Use this pipeline for authZ only. This means that the registry will treat a # Use this pipeline for authZ only. This means that the registry will treat a
# user as authenticated without making requests to keystone to reauthenticate # user as authenticated without making requests to keystone to reauthenticate
# the user. # the user.
[pipeline:glance-api-trusted-auth] [pipeline:glance-api-trusted-auth]
pipeline = versionnegotiation context osprofiler rootapp pipeline = versionnegotiation osprofiler context rootapp
# Use this pipeline for authZ only. This means that the registry will treat a # Use this pipeline for authZ only. This means that the registry will treat a
# user as authenticated without making requests to keystone to reauthenticate # user as authenticated without making requests to keystone to reauthenticate
# the user and uses cache management # the user and uses cache management
[pipeline:glance-api-trusted-auth+cachemanagement] [pipeline:glance-api-trusted-auth+cachemanagement]
pipeline = versionnegotiation context osprofiler cache cachemanage rootapp pipeline = versionnegotiation osprofiler context cache cachemanage rootapp
[composite:rootapp] [composite:rootapp]
paste.composite_factory = glance.api:root_app_factory paste.composite_factory = glance.api:root_app_factory

@ -1,16 +1,16 @@
# Use this pipeline for no auth - DEFAULT # Use this pipeline for no auth - DEFAULT
[pipeline:glance-registry] [pipeline:glance-registry]
pipeline = unauthenticated-context osprofiler registryapp pipeline = osprofiler unauthenticated-context registryapp
# Use this pipeline for keystone auth # Use this pipeline for keystone auth
[pipeline:glance-registry-keystone] [pipeline:glance-registry-keystone]
pipeline = authtoken context osprofiler registryapp pipeline = osprofiler authtoken context registryapp
# Use this pipeline for authZ only. This means that the registry will treat a # Use this pipeline for authZ only. This means that the registry will treat a
# user as authenticated without making requests to keystone to reauthenticate # user as authenticated without making requests to keystone to reauthenticate
# the user. # the user.
[pipeline:glance-registry-trusted-auth] [pipeline:glance-registry-trusted-auth]
pipeline = context osprofiler registryapp pipeline = osprofiler context registryapp
[app:registryapp] [app:registryapp]
paste.app_factory = glance.registry.api:API.factory paste.app_factory = glance.registry.api:API.factory

@ -17,6 +17,7 @@ import os.path
import shutil import shutil
import fixtures import fixtures
import osprofiler.web
import stubout import stubout
from glance.api.middleware import context from glance.api.middleware import context
@ -71,7 +72,7 @@ class TestPasteApp(test_utils.BaseTestCase):
self.assertIsInstance(app, expected_app_type) self.assertIsInstance(app, expected_app_type)
def test_load_paste_app(self): def test_load_paste_app(self):
expected_middleware = context.UnauthenticatedContextMiddleware expected_middleware = osprofiler.web.WsgiMiddleware
self._do_test_load_paste_app(expected_middleware) self._do_test_load_paste_app(expected_middleware)
def test_load_paste_app_paste_config_not_found(self): def test_load_paste_app_paste_config_not_found(self):
@ -90,7 +91,7 @@ class TestPasteApp(test_utils.BaseTestCase):
def test_load_paste_app_with_paste_config_file(self): def test_load_paste_app_with_paste_config_file(self):
paste_config_file = os.path.join(os.getcwd(), paste_config_file = os.path.join(os.getcwd(),
'etc/glance-registry-paste.ini') 'etc/glance-registry-paste.ini')
expected_middleware = context.UnauthenticatedContextMiddleware expected_middleware = osprofiler.web.WsgiMiddleware
self._do_test_load_paste_app(expected_middleware, self._do_test_load_paste_app(expected_middleware,
paste_config_file=paste_config_file) paste_config_file=paste_config_file)