Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache node_types instead of calling on every request #14922

Merged
merged 1 commit into from
Jun 14, 2017

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Apr 27, 2017

For Hosts and Clusters, we display different text for customers who have open stack and those who do not.

We query the database 2-4 queries on every request for this label in the menu.
A typical lean screen has 17 queries.
So 2-4 queries is (11% - 25% by quantity). But these are fast, so % of time is small.

But to be honest, this is more of a frustration PR.

I'm working very hard to delete queries, and these are queries that are run on every page and seem like it should just be a settings.yml flag.

Options:

  1. Run queries for every page <== master
  2. Cache result of logic, only run once every 10 minutes. <=== this PR
  3. put this haml partial into memcache (we avoid memcache for some reason)
  4. Put into settings.yaml.
  5. Delete this feature and let the customer override using their typical localization customization workflow.

@kbrock kbrock changed the title Cache node_types instead of calling every query Cache node_types instead of calling on every request Apr 27, 2017
@kbrock kbrock requested a review from jrafanie May 5, 2017 15:11
@kbrock
Copy link
Member Author

kbrock commented May 5, 2017

/cc @jrafanie I updated comment to show true motivation

We currently query the database 2-4 queries on every request
to determine if we have an open stack provider to display
openstack labels in the menu.
@miq-bot
Copy link
Member

miq-bot commented May 5, 2017

Checked commit kbrock@2a27c11 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@chessbyte
Copy link
Member

@Fryguy @jrafanie bump

:mixed_clusters
else
:openstack
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this but it still feels like this is wrong. We should have cross cloud terminology, a combination of all the things, or a place for them to choose the wording. The fact that we query the database, have lots of backend and UI code to try to figure out what to call things in the UI amazes me. cc @chessbyte

@Fryguy Fryguy merged commit 95ba223 into ManageIQ:master Jun 14, 2017
@Fryguy Fryguy added this to the Sprint 63 Ending Jun 19, 2017 milestone Jun 14, 2017
@kbrock kbrock deleted the detect_openstack branch June 16, 2017 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants