Skip to content

Commit

Permalink
Stop generating vim_performance_tag_values rows
Browse files Browse the repository at this point in the history
  • Loading branch information
gtanzillo committed Jan 2, 2018
1 parent ce1be8e commit a9e3455
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 26 deletions.
1 change: 0 additions & 1 deletion app/models/metric/ci_mixin/rollup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def perf_rollup(time, interval_name, time_profile = nil)
end

Benchmark.realtime_block(:db_update_perf) { perf.update_attributes(new_perf) }
Benchmark.realtime_block(:process_perfs_tag) { VimPerformanceTagValue.build_from_performance_record(perf) }

case interval_name
when "hourly"
Expand Down
2 changes: 0 additions & 2 deletions app/models/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,6 @@ def perf_capture(interval_name, *_args)
perf.update_attributes(attrs)
end

Benchmark.realtime_block(:process_perfs_tag) { VimPerformanceTagValue.build_from_performance_record(perf) }

update_attribute(:last_perf_capture_on, hour)

# We don't rollup realtime to Storage, so we need to manually create bottlenecks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ def write_rows(resources, interval_name, start_time, end_time, data)

if interval_name == 'hourly'
# TODO(lsmola) pff, it needs AR objects, quite ineffective to batch here
samples_arel.find_each do |perf|
Benchmark.realtime_block(:process_perfs_tag) { VimPerformanceTagValue.build_from_performance_record(perf) }
end

_log.info("#{log_header} Adding missing timestamp intervals...")
resources.each do |resource|
Benchmark.realtime_block(:add_missing_intervals) { Metric::Processing.add_missing_intervals(resource, "hourly", start_time, end_time) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ def write_rows(interval_name, resource, start_time, end_time, data)

# TODO: Should we change this into a single metrics.push like we do in ems_refresh?
Benchmark.realtime_block(:process_perfs_db) { perf.update_attributes(v) }

if interval_name == 'hourly'
Benchmark.realtime_block(:process_perfs_tag) { VimPerformanceTagValue.build_from_performance_record(perf) }
end
end

if interval_name == 'hourly'
Expand Down
2 changes: 0 additions & 2 deletions spec/models/vim_performance_tag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
)
end
vm.metric_rollups << perf
VimPerformanceTagValue.build_from_performance_record(perf)
end
vm.save!
end
Expand All @@ -116,7 +115,6 @@
:cpu_usagemhz_rate_average => value
)
@host.metric_rollups << perf
VimPerformanceTagValue.build_from_performance_record(perf)
end
@host.save!
end
Expand Down
13 changes: 0 additions & 13 deletions tools/metrics_populate_retro_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,3 @@
:id => perfs.collect(&:id)
)
end

host_ids = vm_perf_recs.collect(&:parent_host_id).compact.uniq
Host.where(:id => host_ids).order(:id).each do |host|
puts "Updating performance breakdown by tags for VMs under Host: ID: #{host.id} => #{host.name}"

host.preload_vim_performance_state_for_ts(time_cond)
perf_recs = host.metric_rollups.where(time_cond).where(:capture_interval_name => 'hourly')
VimPerformanceTagValue.where(:metric_type => "Host", :metric_id => perf_recs.collect(&:id)).delete_all
perf_recs.each do |perf|
perf.resource.target = host
VimPerformanceTagValue.build_from_performance_record(perf)
end
end

0 comments on commit a9e3455

Please sign in to comment.