Caching of main menu panel list

Bug #1367716 reported by Radomir Dopieralski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Sam Betts

Bug Description

As we are adding more logic to panels for hiding or showing them depending on what is available in other services, we will inevitably have to call out to those other services' APIs to check things. Since the main menu with the panel list is displayed practically on every page, those calls would be made on almost every single request to Horizon. This would slow things considerably, and is also very inconvenient to mock in tests.

The solution to this is to introduce a caching mechanism, which would keep the list of dashboards and panels to be displayed in the session's cache, and which could be conveniently mocked as a whole in tests.

Changed in horizon:
milestone: none → juno-rc1
David Lyle (david-lyle)
Changed in horizon:
status: New → Confirmed
importance: Undecided → High
Sam Betts (sambetts)
Changed in horizon:
assignee: nobody → Sam Betts (sambetts)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/120790

Changed in horizon:
status: Confirmed → In Progress
Changed in horizon:
assignee: Sam Betts (sambetts) → Vlad Okhrimenko (vokhrimenko)
Revision history for this message
Vlad Okhrimenko (vokhrimenko) wrote :

Sorry, it was by mistake(when I rebased my patch with your).

Sam Betts (sambetts)
Changed in horizon:
assignee: Vlad Okhrimenko (vokhrimenko) → Sam Betts (sambetts)
David Lyle (david-lyle)
Changed in horizon:
milestone: juno-rc1 → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/120790
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=16db58fabad8934b8fbdfc6aee0361cc138b20af
Submitter: Jenkins
Branch: master

commit 16db58fabad8934b8fbdfc6aee0361cc138b20af
Author: Sam Betts <email address hidden>
Date: Thu Sep 11 14:49:54 2014 +0100

    Add a session cache of can_access call results

    This patch adds a decorator and function to all horizon components so
    that the results of calls to can_access are cached in the session. This
    should prevent large numbers of calls to APIs when can_access functions
    need to get information from services. The cache is stored in
    session['allowed'] using self.__class__ as the key, this ensures each
    key is human readable and can be easily mocked out in future tests.

    Change-Id: Ic65e4cb6499ecae4b09dd525416656a6f41853f5
    Closes-Bug: 1367716

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.