-
Notifications
You must be signed in to change notification settings - Fork 897
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
Inventory task #16980
Inventory task #16980
Conversation
4c09acc
to
c5e6e55
Compare
Looks good, the performance enhancement is a nice "extra". |
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.
Feels like a lot of iteration over the data array, but maybe it's not as bad as I'm thinking.
app/models/ext_management_system.rb
Outdated
ems.try(:containers).try(:count) | ||
] | ||
end | ||
unless data.empty? |
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.
return if data.empty?
app/models/ext_management_system.rb
Outdated
# remove 0's (except for the region) | ||
data = data.map { |row| row.each_with_index.map { |col, i| i > 0 && col == 0 ? nil : col } } | ||
data.unshift(%w(region zone kind ems clusters hosts vms storages containers)) | ||
# remove columns where all values (except for the header) are blank |
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.
@bdunne this is mostly for containers. yea - others won't be empty
app/models/ext_management_system.rb
Outdated
# remove 0's (except for the region) | ||
data = data.map { |row| row.each_with_index.map { |col, i| i > 0 && col == 0 ? nil : col } } | ||
data.unshift(%w(region zone kind ems clusters hosts vms storages containers)) | ||
# remove columns where all values (except for the header) are blank |
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.
@bdunne this is mostly for containers. yea - others won't be empty
6b2066c
to
62b6345
Compare
app/models/ext_management_system.rb
Outdated
# remove 0's (except for the region) | ||
data = data.map { |row| row.each_with_index.map { |col, i| i > 0 && col == 0 ? nil : col } } | ||
data.unshift(%w(region zone kind ems clusters hosts vms storages containers)) | ||
# remove columns where all values (except for the header) are blank |
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.
thanks @bdunne - I added specs to exercise this. yea it is mostly for the container column
ugh - I deleted your comment instead of mine
a636a7e
to
dc5b5d2
Compare
this outputs general counts for all inventories
also don't display the column if it is empty (or all 0)
dc5b5d2
to
3f2ca09
Compare
Some comments on commits kbrock/manageiq@df28c1f~...3f2ca09 lib/tasks/evm.rake
|
Checked commits kbrock/manageiq@df28c1f~...3f2ca09 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
When support wants a quick snapshot of an installation, they just want to know
the general layout for regions, zones, and emses. The numbers for the size of the ems installations as well.
This adds the
evm:inventory
task to display the current inventoryThis also fixed 2 virtual columns that were not executing in sql, but rather in ruby. storages_count is still an N+1 query.