diff --git a/app/models/metric/ci_mixin/rollup.rb b/app/models/metric/ci_mixin/rollup.rb index 0c837432c2c9..723b73b17fdc 100644 --- a/app/models/metric/ci_mixin/rollup.rb +++ b/app/models/metric/ci_mixin/rollup.rb @@ -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" diff --git a/app/models/storage.rb b/app/models/storage.rb index 1441608bc786..e07a1aa4f5f4 100644 --- a/app/models/storage.rb +++ b/app/models/storage.rb @@ -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 diff --git a/lib/active_metrics/connection_adapters/miq_postgres_adapter.rb b/lib/active_metrics/connection_adapters/miq_postgres_adapter.rb index badefb7df4e0..655a78c3fc17 100644 --- a/lib/active_metrics/connection_adapters/miq_postgres_adapter.rb +++ b/lib/active_metrics/connection_adapters/miq_postgres_adapter.rb @@ -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) } diff --git a/lib/active_metrics/connection_adapters/miq_postgres_legacy_adapter.rb b/lib/active_metrics/connection_adapters/miq_postgres_legacy_adapter.rb index b2d7f269761e..d532b139618b 100644 --- a/lib/active_metrics/connection_adapters/miq_postgres_legacy_adapter.rb +++ b/lib/active_metrics/connection_adapters/miq_postgres_legacy_adapter.rb @@ -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' diff --git a/spec/models/vim_performance_tag_spec.rb b/spec/models/vim_performance_tag_spec.rb index a0b846d666c9..692b00339f49 100644 --- a/spec/models/vim_performance_tag_spec.rb +++ b/spec/models/vim_performance_tag_spec.rb @@ -105,7 +105,6 @@ ) end vm.metric_rollups << perf - VimPerformanceTagValue.build_from_performance_record(perf) end vm.save! end @@ -116,7 +115,6 @@ :cpu_usagemhz_rate_average => value ) @host.metric_rollups << perf - VimPerformanceTagValue.build_from_performance_record(perf) end @host.save! end diff --git a/tools/metrics_populate_retro_tags.rb b/tools/metrics_populate_retro_tags.rb index 2af0ed5e8c89..80fdb15867ca 100755 --- a/tools/metrics_populate_retro_tags.rb +++ b/tools/metrics_populate_retro_tags.rb @@ -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