Skip to content

Commit 4588ceb

Browse files
committed
Use batches for C&U Metrics capture
- this parameter tells cap&u perf_capture to send batches of 250 records to vmware at a time - removed targets/log_targets since this has been moved to the base class - changed data to work without the beginning_of_day in realtime default startime 4.hour.ago.beginning_of_day
1 parent 3bddd34 commit 4588ceb

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

app/models/manageiq/providers/vmware/infra_manager/metrics_capture.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ def self.process_entity(data, parent = nil)
234234
ret
235235
end
236236

237-
alias targets target
238237
def initialize(target, ems = nil)
239238
super(Array(target), ems || Array(target).first&.ext_management_system)
240239

@@ -390,16 +389,6 @@ def perf_query(params, counter_info, interval_name)
390389
return counters_by_mor, counter_values_by_mor_and_ts
391390
end
392391

393-
private
394-
395-
def log_targets
396-
if targets.size == 1
397-
"[#{targets.first.class.name}], [#{targets.first.id}], [#{targets.first.name}]"
398-
else
399-
"[#{targets.map { |obj| obj.class.name }.uniq.join(", ")}], [#{targets.size} targets]"
400-
end
401-
end
402-
403392
class << self
404393
private
405394

config/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:critical:
99
:power:
1010
:critical:
11+
:capture_batch_size: 250
1112
:ems_refresh:
1213
:vmware_tanzu:
1314
:refresh_interval: 24.hours

spec/models/manageiq/providers/vmware/infra_manager/metric_capture_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
end
3636

3737
context "collecting vm realtime data" do
38-
let(:start_time) { Time.parse("2011-08-12T00:00:00Z").utc }
38+
let(:start_time) { Time.parse("2011-08-12T19:33:00Z").utc }
3939

4040
before(:each) do
4141
@counters_by_mor, @counter_values_by_mor_and_ts = @vm.perf_collect_metrics('realtime', start_time)

spec/tools/vim_data/miq_vim_perf_history/queryPerfMulti.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
vimType: :VirtualMachine
55
xsiType: :ManagedObjectReference
66
: '20':
7-
'2011-08-12T00:00:00Z':
7+
'2011-08-12T19:33:00Z':
88
! '': !ruby/array:VimArray
99
- !ruby/hash-with-ivars:VimHash
1010
elements:

0 commit comments

Comments
 (0)