It looks like we're looking for max_mem_usage_absolute_average on the container project's rollup. The min_max column for a project rollup has: min_max: {:min_cpu_usage_rate_average=>0.00972642547331155, :max_cpu_usage_rate_average=>0.0106778331585571, :min_net_usage_rate_average=>32616.2553808593, :max_net_usage_rate_average=>89984.0963381619, :min_derived_memory_used=>5177.35364583333, :max_derived_memory_used=>5366.46692708333, :min_derived_vm_count_on=>0.0, :max_derived_vm_count_on=>0.0, :min_derived_host_count_on=>0.0, :max_derived_host_count_on=>0.0, :min_derived_vm_count_off=>0.0, :max_derived_vm_count_off=>0.0, :min_derived_host_count_off=>0.0, :max_derived_host_count_off=>0.0, :min_derived_vm_numvcpus=>588.0, :max_derived_vm_numvcpus=>620.0, :min_derived_host_count_total=>0.0, :max_derived_host_count_total=>0.0, :min_derived_vm_count_total=>0.0, :max_derived_vm_count_total=>0.0, :min_stat_container_group_create_rate=>0.0, :max_stat_container_group_create_rate=>1.0, :min_stat_container_group_delete_rate=>0.0, :max_stat_container_group_delete_rate=>2.0}, It's missing max_mem_usage_absolute_average, so I think that's why we're not seeing it. I'm not sure if we capture that data for container projects.
Ladas, who might be able to look at this issue? I'm not familiar with how we collect/rollup metrics for container/pods/projects.
I think the issue is that VimPerformanceState#total_mem is set here https://github.com/ManageIQ/manageiq/blob/master/app/models/vim_performance_state.rb#L165 which relies on either container_project.aggregate_memory or container_project.hardware.memory_mb, neither of which are there. This probably never worked since we haven't changed aggregation/rollups in a long time.
Confirmed that if I add a method aggregate_memory to ContainerProject then I get a non-zero value in VimPerformanceState.mem_usage_absolute_average. I recommend added an aggregate_memory method to ContainerProject which uses the aggregate_hardware from container_nodes.
Adam hi, > I recommend added an aggregate_memory method to ContainerProject which uses the aggregate_hardware from container_nodes. Tried to add the aggregate_memory method and got some errors, assigning this bug to you. Thanks Kobi
Hi Yaacov, what errors? If you want to open a WIP PR we can discuss there.
Adam this is the current code changes, this does not work. Can some one from core team help here ? diff --git a/app/models/container_project.rb b/app/models/container_project.rb index d5e89d67cd..87b780a6d4 100644 --- a/app/models/container_project.rb +++ b/app/models/container_project.rb @@ -43,6 +43,7 @@ class ContainerProject < ApplicationRecord include EventMixin include Metric::CiMixin + include AggregationMixin::Methods PERF_ROLLUP_CHILDREN = :all_container_groups @@ -69,6 +70,14 @@ class ContainerProject < ApplicationRecord [] end + def all_container_node_ids + return container_nodes.ids + end + + def aggregate_memory(targets = nil) + aggregate_hardware(:container_nodes, :memory_mb, targets) + end +
submitted upstream: https://github.com/ManageIQ/manageiq/pull/18159 Note: I do not know how the aggregation code works, so I do not know it this actually solve the problem. If someone can reproduce the BZ with and without this fix it will be very helpful.
merged upstream: https://github.com/ManageIQ/manageiq/pull/18159
New commit detected on ManageIQ/manageiq/hammer: https://github.com/ManageIQ/manageiq/commit/58788a9dcf7205712837e301bfc57073af45e911 commit 58788a9dcf7205712837e301bfc57073af45e911 Author: Adam Grare <agrare> AuthorDate: Mon Nov 5 15:18:47 2018 -0500 Commit: Adam Grare <agrare> CommitDate: Mon Nov 5 15:18:47 2018 -0500 Merge pull request #18159 from yaacov/wip-add-aggregate_memory-to-container-project Add aggregate_memory to container project (cherry picked from commit edd65ff422b8179622b284a549bfb4afe92168ce) https://bugzilla.redhat.com/show_bug.cgi?id=1618536 app/models/container_project.rb | 17 + 1 file changed, 17 insertions(+)
FIXED. Verified on 5.10.0.25.20181120211723_d2fd659.