Merge "Add support for [polling] batch_size"

This commit is contained in:
Zuul 2021-11-17 13:16:32 +00:00 committed by Gerrit Code Review
commit 8a567216f7
3 changed files with 23 additions and 0 deletions

View File

@ -54,6 +54,10 @@
# This is used only if manage_polling is true. # This is used only if manage_polling is true.
# Defaults to undef # Defaults to undef
# #
# [*batch_size*]
# (Optional) Batch size of samples to send to notification agent.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
# #
# [*coordination_url*] # [*coordination_url*]
@ -72,6 +76,7 @@ class ceilometer::agent::polling (
$polling_interval = 600, $polling_interval = 600,
$polling_meters = $::ceilometer::params::polling_meters, $polling_meters = $::ceilometer::params::polling_meters,
$polling_config = undef, $polling_config = undef,
$batch_size = $::os_service_default,
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$coordination_url = undef, $coordination_url = undef,
) inherits ceilometer { ) inherits ceilometer {
@ -135,6 +140,10 @@ class ceilometer::agent::polling (
} }
} }
ceilometer_config {
'polling/batch_size': value => $batch_size
}
if $manage_service { if $manage_service {
if $enabled { if $enabled {
$service_ensure = 'running' $service_ensure = 'running'

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``ceilometer::agent::polling`` class now suppports the new
``batch_size`` parameter.

View File

@ -48,6 +48,7 @@ describe 'ceilometer::agent::polling' do
:tag => 'ceilometer-service', :tag => 'ceilometer-service',
)} )}
it { should contain_ceilometer_config('polling/batch_size').with_value('<SERVICE DEFAULT>') }
it { should_not contain_file('polling') } it { should_not contain_file('polling') }
end end
@ -219,6 +220,14 @@ sources:
it { should contain_ceilometer_config('coordination/backend_url').with_value('redis://localhost:6379') } it { should contain_ceilometer_config('coordination/backend_url').with_value('redis://localhost:6379') }
end end
context 'when batch_size is set' do
before do
params.merge!( :batch_size => 50 )
end
it { should contain_ceilometer_config('polling/batch_size').with_value(50) }
end
end end
on_supported_os({ on_supported_os({