These are chat archives for ManageIQ/manageiq/performance

6th
Jul 2016
Keenan Brock
@kbrock
Jul 06 2016 19:36
@Fryguy As more and more comments come in, ManageIQ/manageiq#9447 is growing even bigger. Not sure when you have some time to put this baby to rest.
Nick LaMuro
@NickLaMuro
Jul 06 2016 20:00
@kbrock Just as an FYI, I don't think virtual_delegates are the right hammer for human_status, since it is a case statement around two columns: https://github.com/manageIQ/manageiq/blob/master/app/models/miq_task.rb#L141-L156
Nick LaMuro
@NickLaMuro
Jul 06 2016 20:14
I think I have a way to solve it for our case to avoid duplicating the code, but working on how that would work out
Keenan Brock
@kbrock
Jul 06 2016 20:24
we had a field in vms that was based upon hardware
it was too hard to test
so I moved the field into hardware
but I still needed to access that value from vms
and I didn't want to N+1 the sucker. (and wanted to sort)
so using arel allowed us to sort by that value in sql
virtual_delegate is lipstick
@NickLaMuro thanks for looking into this. the best case would be to have a way for virtual_attribute to have :arel so we can just pull it back in 1 query and not deal with the n+1 joins. (note, virtual_total and virtual_delegate are wrappers that do just that)
Keenan Brock
@kbrock
Jul 06 2016 20:32
almost feels like we should merge state and status together - that would sure simplify things.
And provide a way to call a mapping function from our reports (think we may already have this)
Remember, if this is in ruby, then sorting by it becomes a bear - (why I'm pushing arel and simplification)
Nick LaMuro
@NickLaMuro
Jul 06 2016 20:42
At least for this use case, the sorting is a non-issue, since it is only used to determine the png status image on the page