manageiq
manageiq copied to clipboard
[WIP] Virtual attributes for Containers and friends (performance changes)
depends upon:
- [x] https://github.com/ManageIQ/activerecord-virtual_attributes/pull/120
- ~~https://github.com/ManageIQ/activerecord-virtual_attributes/pull/127~~
@agrare Can we outright claim that PersistentVolume#parent
is always an Ems
?
I get that a ContainerVolume#parent
is polymorphic, but curious about the child class (i.e.: PersistentVolume
). If not, may need to drop that change.
Numbers
ms | query | qry ms | rows | comments |
---|---|---|---|---|
347.2 | 32 | 53.2 | 128 | /container_node/report_data#node-index |
308.8 | 11 | 10.3 | 28 | /container_node/report_data#node-after |
11.1% | 66% | 80.6% | 78% | diff |
ms | query | qry ms | rows | comments |
---|---|---|---|---|
428.0 | 32 | 123.2 | 88 | /container_group/report_data#group-index |
336.5 | 11 | 65.5 | 28 | /container_group/report_data#group-after |
21.4% | 66% | 46.8% | 68% | diff |
ms | query | qry ms | rows | comments |
---|---|---|---|---|
424.3 | 51 | 98.7 | 48 | /container_image/report_data |
345.1 | 11 | 34.4 | 28 | /container_image/report_data |
18.7% | 78% | 65.1% | 42% | diff |
no longer:
ms | query | qry ms | rows | comments |
---|---|---|---|---|
278.6 | 31 | 12.7 | 48 | /persistent_volume/report_data#before |
258.7 | 11 | 9.9 | 28 | /persistent_volume/report_data#after |
7.1% | 65% | 22.0% | 42% | diff |
@kbrock it definitely defaults to the EMS I don't know if that is the only possible option but it does appear like it based on the kubernetes parser
update:
- rebased master
- updated test to mark now sql friendly virtual attribute as ... sql friendly.
update:
- extracted container volume assumption that the persistent volume is always associated with an ems.
The savings are very good, but I am not ready to put my foot down on that one. The other changes are pretty much a no brainer.
UN-WIP: concerning commit around container volume and ems relationships
update:
- rubocops: add :dependent, :inverse_of
WIP: confusing CI values
I'm very confused by the failure. This works locally and I can't imagine where this could be going wrong. All test failures are the same. (I wrote the specs at the same time)
The spec(s) only shows partial SQL, but it looks like where(:id => subject.id)
is sending the container_node.id
as text instead of a numeric.
# rspec ./spec/models/container_group_spec.rb:53
# rspec ./spec/models/container_group_spec.rb:61
# rspec ./spec/models/container_node_spec.rb:50 <==
PG::UndefinedFunction: ERROR: operator does not exist: bigint = text
LINE 1: ...OM "container_nodes" WHERE "container_nodes"."id" = $1 ORDER...
Again, the sql generated locally is working fine.
Also interesting:
subj = described_class.where(:id => container_group.id)
expect(subj.first.ready_condition_status).to eq("None") # works
expect(subj.select(:ready_condition_status).first.ready_condition_status).to eq("None") # failure
update:
- rebase
- fixed extra file committed (thnx fry)
Overall LGTM - one real question, and some specs are failing, but maybe they go away with a rebase since Ruby 2.7 is gone now.
This pull request has been automatically marked as stale because it has not been updated for at least 3 months.
If these changes are still valid, please remove the stale
label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).
This pull request has been automatically marked as stale because it has not been updated for at least 3 months.
If these changes are still valid, please remove the stale
label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).