Skip to content

[WIP] Resource performance fix#79

Open
abellotti wants to merge 11 commits intoManageIQ:masterfrom
abellotti:resource_performance_fix
Open

[WIP] Resource performance fix#79
abellotti wants to merge 11 commits intoManageIQ:masterfrom
abellotti:resource_performance_fix

Conversation

@abellotti
Copy link
Member

Fixed serious performance issue where miq.providers.find(provider_id).vms.collect(&:name) was querying the API server for provider actions for each VM.

Followup to #61

will unwip/rebase once #61 is merged.

abellotti added 11 commits April 2, 2018 14:47
- Dynamically driven by the "subcollections" exposed via OPTIONS /api/:collection
- supports queries and actions

  Queries:
  miq.vms.find(166).tags.collect(&:name)
  miq.vms.find(166).tags.select(:categorization).collect(&:categorization)

  Subcollection Actions:
  miq.vms.find(166).tags.assign(:name => "/managed/location/ny")
  miq.vms.find(166).tags.assign([{:name => "/managed/location/chicago"}, {:name => "/managed/cc/001"}])

  Subcollection resource actions:
  miq.vms.find(166).tags.find(32).unassign
  miq.vms.find(166).tags.where(:name => "/managed/location/*").collect(&:unassign)

Fixes: ManageIQ#31
Fixes: ManageIQ#32
- Moving action specific action methods for resources and subresources to seperate mixin.
- Moving action specific action methods for collections and subcollections to seperate mixin.
- Moving common queryable methods for collections and subcollections to a common QueryableMixin
- Updated options response fixture to include subcollections
- Added collection rspecs
- Added resource rspecs
- Add tests for subcollections
- Adding resource actions_vms.json
- Adding subcollection actions_vm_tags.json
- Adding tests for subresources
….vms.collect(&:name) was querying

the API server for provider actions for each VM.
@chessbyte
Copy link
Member

@abellotti if this is a viable PR, please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants