-
Notifications
You must be signed in to change notification settings - Fork 896
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
change aggregation mixin methods into virtual attributes #20149
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
module AggregationMixin | ||
extend ActiveSupport::Concern | ||
included do | ||
virtual_column :aggregate_cpu_speed, :type => :integer, :uses => :hosts | ||
virtual_column :aggregate_cpu_total_cores, :type => :integer, :uses => :hosts | ||
virtual_column :aggregate_physical_cpus, :type => :integer, :uses => :hosts | ||
virtual_column :aggregate_memory, :type => :integer, :uses => :hosts | ||
virtual_column :aggregate_vm_cpus, :type => :integer, :uses => :vms_and_templates | ||
virtual_column :aggregate_vm_memory, :type => :integer, :uses => :vms_and_templates | ||
virtual_column :aggregate_disk_capacity, :type => :integer, :uses => :hosts | ||
|
||
alias_method :all_hosts, :hosts | ||
alias_method :all_host_ids, :host_ids | ||
alias_method :all_vms_and_templates, :vms_and_templates | ||
alias_method :all_vm_or_template_ids, :vm_or_template_ids | ||
alias_method :all_vms, :vms | ||
alias_method :all_vm_ids, :vm_ids | ||
alias_method :all_miq_templates, :miq_templates | ||
alias_method :all_miq_template_ids, :miq_template_ids | ||
d-m-u marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
include AggregationMixin::Methods | ||
virtual_aggregate :aggregate_cpu_speed, :host_hardwares, :sum, :aggregate_cpu_speed | ||
NickLaMuro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
virtual_aggregate :aggregate_cpu_total_cores, :host_hardwares, :sum, :cpu_total_cores | ||
virtual_aggregate :aggregate_disk_capacity, :host_hardwares, :sum, :disk_capacity | ||
virtual_aggregate :aggregate_memory, :host_hardwares, :sum, :memory_mb | ||
virtual_aggregate :aggregate_physical_cpus, :host_hardwares, :sum, :cpu_sockets | ||
virtual_aggregate :aggregate_vm_cpus, :vm_hardwares, :sum, :cpu_sockets | ||
virtual_aggregate :aggregate_vm_memory, :vm_hardwares, :sum, :memory_mb | ||
end | ||
end |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ module RelationshipsAggregationMixin | |
virtual_column :aggregate_vm_cpus, :type => :integer, :uses => :all_relationships | ||
virtual_column :aggregate_vm_memory, :type => :integer, :uses => :all_relationships | ||
virtual_column :aggregate_disk_capacity, :type => :integer, :uses => :all_relationships | ||
|
||
include AggregationMixin::Methods | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like by deleting this file, two files now have lost the functionality of this module:
And don't seem to be addressed by this PR. Is that a problem or by design? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Neither of them have the relationships necessary to make any of the aggregate methods work, so no loss there. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. by a Keenan 👍 I assume he was going with, we're okay here anyway There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going to leave this unresolved in case it comes up in the future as a problem, so it is more easy for it to be noticed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following error shows on current master when clicking on a resource pool, trying to render its textual summary:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
end | ||
|
||
# Default implementations which can be overridden with something more optimized | ||
|
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.
possible to swap with virtual total?
(if not, then that is ok)
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.
methinks not