Use caching for resource name/id finders

Use caching to reduce the number of client calls.

Change-Id: Ic22dfac0a5ea8c0f1ae7b83d37492e935f259db8
This commit is contained in:
Rabi Mishra
2016-02-17 12:24:55 +05:30
parent dfbb0fb848
commit 54aa3ea5e1
5 changed files with 53 additions and 5 deletions

View File

@@ -73,6 +73,24 @@ def register_cache_configurations(conf):
conf.register_group(extension_cache_group)
conf.register_opts(extension_cache_opts, group=extension_cache_group)
find_cache_group = cfg.OptGroup('resource_finder_cache')
find_cache_opts = [
cfg.IntOpt('expiration_time', default=3600,
help=_(
'TTL, in seconds, for any cached item in the '
'dogpile.cache region used for caching of OpenStack '
'service finder functions.')),
cfg.BoolOpt('caching', default=True,
help=_(
'Toggle to enable/disable caching when Orchestration '
'Engine looks for other OpenStack service resources '
'using name or id. Please note that the global '
'toggle for oslo.cache(enabled=True in [cache] group) '
'must be enabled to use this feature.'))
]
conf.register_group(find_cache_group)
conf.register_opts(find_cache_opts, group=find_cache_group)
return conf