-
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
Vim performance scope #7260
Vim performance scope #7260
Conversation
@gtanzillo please review |
|
||
if obj.kind_of?(MiqEnterprise) || obj.kind_of?(MiqRegion) | ||
cond1 = klass.send(:sanitize_sql_for_conditions, :resource_type => "Storage", :resource_id => obj.storage_ids) | ||
cond2 = klass.send(:sanitize_sql_for_conditions, :resource_type => "ExtManagementSystem", :resource_id => obj.ext_management_system_ids) | ||
cond += " AND ((#{cond1}) OR (#{cond2}))" | ||
rel = rel.where("((#{cond1}) OR (#{cond2}))") |
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.
While we're here, you can or
this, and thus kill the sanitize calls.
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.
@matthewd that was my question - what does this OR
code look like?
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.
rel = rel.where(resource: obj.storages).or(rel.where(resource: obj.ext_management_systems))
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
bb29dad
to
80d4fe4
Compare
WIPping until I get a test into here |
19af989
to
81fd207
Compare
|
remove call to VimPerformanceDaily#find_entries with :reflections It is ignored
convert timestamp and other conditions to scope
VimPerformanceAnalysis.find_perf_for_time_period and child version call into VimPerformanceDaily.find_entries, and does not use :only_cols
81fd207
to
67fff45
Compare
fixed rubocops. @matthewd Think I addressed all your concerns/suggestions. Followup PR extracts the scopes and sunsets |
67fff45
to
ef808e3
Compare
Checked commits kbrock/manageiq@7aa7690~...ef808e3 with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 app/models/miq_report/generator/utilization.rb
spec/models/vim_performance_analysis_spec.rb
|
This is focused on
VimPerformanceDaily.find_entries
The goal is to remove allow scopes to be used instead. Rbac will be able to convert
VimPerformanceDaily
into a scope and much of the specialized logic aroundscope
andklass
can be removed.After this, think we can pull
klass
lookup out offind_entries
Let me know the best way to code the
OR
if you think I should convert that too./cc @matthewd This is a follow up to our conversation.