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

Cu capture move capture queue #19599

Merged
merged 8 commits into from
Dec 5, 2019

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Dec 5, 2019

extracted from #19492

For cap&u capture, the logic for putting an ems onto the queue lives in metrics_capture.rb.
This PR moves the logic for putting each ems object onto the queue to metrics_capture.rb.

Before

All vendors put the vm collection requests into the queue in the same way.
VMware specific scenarios like only collecting the past 4 hours of realtime metrics are applied to all vendors.

After

queuing is more streamlines and can be overridden per ems vendor.

No longer looking up queue names and ems multiple times.

the goal is to move from capturing each object individually,
to capturing a group of objects in one fell swoop.
this is moving to a class that is not mixed into the individual objects
So change them up front before the move
target is passed in since self is no longer the individual target.
This commit is probably the one that threw me the most in this chain,
because the kind_of will silently fail if you don't add the target there.

This code in general is VMWare specific, so getting it into provider
specific class is key.
already have ems so no need to lookup per target
Zone is taken from the ems, and only looked up once.
This removes the need to cache the zone in the hash.

This is possible because perf_capture_queue is now in this file
perf_capture_queue is an internal method now.
So there parameters do not need to be checked.

The interval is determined from perf_target_to_interval_name, which
is 100% under our control, and the options hash, which is from
perf_capture_gap or perf_capture_realtime_now. (and the last one
is slated to go away soon)

Checking on every insert seemed like waste
@miq-bot
Copy link
Member

miq-bot commented Dec 5, 2019

Checked commits kbrock/manageiq@f79ff20~...6c88b86 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 👍

@agrare agrare merged commit eef634d into ManageIQ:master Dec 5, 2019
@agrare agrare added this to the Sprint 126 Ending Dec 9, 2019 milestone Dec 5, 2019
@agrare agrare self-assigned this Dec 5, 2019
@kbrock kbrock deleted the cu_capture_move_capture_queue branch December 5, 2019 18:16
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.

3 participants