]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Add support for [polling] batch_size
authorTakashi Kajinami <tkajinam@redhat.com>
Fri, 5 Nov 2021 00:27:42 +0000 (09:27 +0900)
committerYadnesh Kulkarni <yadnesh_kulkarni@proton.me>
Thu, 20 Apr 2023 12:29:23 +0000 (17:59 +0530)
Change-Id: I44f07afcdd5a723afda8a9fb2abd698508694278
(cherry picked from commit c3c1afb8bd9d446a4be2c96f640f44e10f45541e)

manifests/agent/polling.pp
releasenotes/notes/polling-batch_size-95f15dc9d96b96b4.yaml [new file with mode: 0644]
spec/classes/ceilometer_agent_polling_spec.rb

index c0914492a7a619278c9dd211b7d2c9605dc56a09..8e3e4c11497a074be53fc3464529b315f056e4df 100644 (file)
 #   This is used only if manage_polling is true.
 #   Defaults to undef
 #
+# [*batch_size*]
+#   (Optional) Batch size of samples to send to notification agent.
+#   Defaults to $::os_service_default
+#
 # DEPRECATED PARAMETERS
 #
 # [*coordination_url*]
@@ -83,6 +87,7 @@ class ceilometer::agent::polling (
   $polling_interval          = 600,
   $polling_meters            = $::ceilometer::params::polling_meters,
   $polling_config            = undef,
+  $batch_size                = $::os_service_default,
   # DEPRECATED PARAMETERS
   $coordination_url          = undef,
 ) inherits ceilometer {
@@ -160,6 +165,10 @@ class ceilometer::agent::polling (
     }
   }
 
+  ceilometer_config {
+    'polling/batch_size': value => $batch_size
+  }
+
   if $manage_service {
     if $enabled {
       $service_ensure = 'running'
diff --git a/releasenotes/notes/polling-batch_size-95f15dc9d96b96b4.yaml b/releasenotes/notes/polling-batch_size-95f15dc9d96b96b4.yaml
new file mode 100644 (file)
index 0000000..403871e
--- /dev/null
@@ -0,0 +1,5 @@
+---
+features:
+  - |
+    The ``ceilometer::agent::polling`` class now suppports the new
+    ``batch_size`` parameter.
index 40e7d979247046e387cdf369cac3f9fb88be7c78..32d450d7b4be88ac8a558648c1c6ec3397fdac8c 100644 (file)
@@ -52,6 +52,7 @@ describe 'ceilometer::agent::polling' do
         :tag        => 'ceilometer-service',
       )}
 
+      it { should contain_ceilometer_config('polling/batch_size').with_value('<SERVICE DEFAULT>') }
       it { should_not contain_file('polling') }
     end
 
@@ -260,6 +261,14 @@ sources:
 
       it { should contain_ceilometer_config('coordination/backend_url').with_value('redis://localhost:6379') }
     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
 
   on_supported_os({