-
Notifications
You must be signed in to change notification settings - Fork 898
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
Metric::Rollup - simplify column declarations #22608
Conversation
WIP: not sure that the aggregation is correct for TODO: verify that aggregation is working, then verify if the vms are the same thing. |
UN-WIP: removed EmsCluster changes. so this PR is now just the 2 refactors around rollup |
app/models/metric/rollup.rb
Outdated
BASIC_VM_CPU_COLS = [:cpu_usage_rate_average, :derived_vm_numvcpus, :derived_memory_used, :net_usage_rate_average].freeze | ||
BASIC_VM_DISK_COLS = [:cpu_usage_rate_average, :derived_memory_used, :disk_usage_rate_average, :net_usage_rate_average].freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first set is really around container usage, not vm usage. Also it includes more than CPU. Also, also the pattern is to use the phrase ROLLUP_COLS (aside from storage), so I'm thinking rename to something like:
BASIC_VM_CPU_COLS = [:cpu_usage_rate_average, :derived_vm_numvcpus, :derived_memory_used, :net_usage_rate_average].freeze | |
BASIC_VM_DISK_COLS = [:cpu_usage_rate_average, :derived_memory_used, :disk_usage_rate_average, :net_usage_rate_average].freeze | |
CONTAINER_ROLLUP_COLS = [:cpu_usage_rate_average, :derived_vm_numvcpus, :derived_memory_used, :net_usage_rate_average].freeze | |
VM_ROLLUP_COLS = [:cpu_usage_rate_average, :derived_memory_used, :disk_usage_rate_average, :net_usage_rate_average].freeze |
extract logic into own method
update:
|
Checked commits kbrock/manageiq@d10075a~...9f6b517 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
@Fryguy I think this is ready for merge. Probably without backport (since it is low risk, but no need to backport) |
3 commits:
Metric::Rollup
: dedup common rollup aggregate column listsMetric::Rollup#aggregate_column
dropVimPerformanceState
special case for looking upEmsCluster#vms