Skip to content

Commit

Permalink
Only collect rollup associations
Browse files Browse the repository at this point in the history
VimPerformanceState are used to represent an object in the past.
These records are used for metrics rollups, metric calculations, and chargeback calculations
Do note, that chargeback calculations do contain some form of a rollup.

We only rollup metrics by the PERF_ROLLUP_CHILDREN association.
Collecting all these other grow our VimPerformanceState table and take up processing time,
for collecting vps and downloading vps.
  • Loading branch information
kbrock committed Jul 10, 2023
1 parent f63d508 commit aae12e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/vim_performance_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class VimPerformanceState < ApplicationRecord

belongs_to :resource, :polymorphic => true

ASSOCIATIONS = [:vms, :hosts, :ems_clusters, :ext_management_systems, :storages, :container_nodes, :container_groups,
:all_container_groups, :containers]
# we want these even if we don't roll them up
ASSOCIATIONS = Metric::Rollup::ASSOC_KEYS

# Define accessors for state_data information
[
Expand Down Expand Up @@ -187,7 +187,7 @@ def capture_total(field)

def capture_assoc_ids
result = {}
ASSOCIATIONS.each do |assoc|
(ASSOCIATIONS + resource.class::PERF_ROLLUP_CHILDREN).uniq.each do |assoc|
method = if assoc == :vms
if resource.kind_of?(EmsCluster)
:all_vms_and_templates
Expand Down

0 comments on commit aae12e2

Please sign in to comment.