summaryrefslogtreecommitdiff
path: root/tuskar_ui/api/tuskar.py
diff options
context:
space:
mode:
authorRyan Brady <rbrady@redhat.com>2015-06-30 23:25:38 -0400
committerRyan Brady <rbrady@redhat.com>2015-06-30 23:25:38 -0400
commit202329f64e1c492554685f115ed1b4d6891bae1b (patch)
treeba7e4ecb65701b870e615f21c6cfe9ac9ebed7cb /tuskar_ui/api/tuskar.py
parent9f7d333d2cc71a48f607f4e7a2396d36cf04cd5f (diff)
downloadtuskar-ui-202329f64e1c492554685f115ed1b4d6891bae1b.tar.gz
Adds selected memoization
Page load times in tuskar-ui are too slow. This patch adds some caching to the tuskarclient and its list function to reduce page load time. Tests locally showed these changes decreased page load time by half in a virt environment. Change-Id: Ib5d67dc2c1a58011739b81156fa50f5cccb223d4
Diffstat (limited to 'tuskar_ui/api/tuskar.py')
-rw-r--r--tuskar_ui/api/tuskar.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tuskar_ui/api/tuskar.py b/tuskar_ui/api/tuskar.py
index 6dd1785e..c97f93e7 100644
--- a/tuskar_ui/api/tuskar.py
+++ b/tuskar_ui/api/tuskar.py
@@ -39,6 +39,7 @@ KEYSTONE_CERTIFICATE_PARAMS = (
'KeystoneSigningKey')
+@memoized.memoized
def tuskarclient(request, password=None):
api_version = "2"
insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
@@ -152,6 +153,7 @@ class Plan(base.APIResourceWrapper):
return cls(plan, request=request)
@classmethod
+ @memoized.memoized
def list(cls, request):
"""Return a list of Plans in Tuskar