]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
notification: Support tuning batch processing
authorTakashi Kajinami <tkajinam@redhat.com>
Mon, 23 Jan 2023 07:11:38 +0000 (16:11 +0900)
committerTakashi Kajinami <tkajinam@redhat.com>
Mon, 23 Jan 2023 14:06:47 +0000 (23:06 +0900)
This change introduces support for the option to tune batch processing
by notification agent.

Change-Id: I9cdbbe9becfffce68966a29b9e803218637d7714

manifests/agent/notification.pp
releasenotes/notes/notification-batch-opts-c9284092587ca561.yaml [new file with mode: 0644]
spec/classes/ceilometer_agent_notification_spec.rb

index e417ef623fa8dedd71acb53a26ff6bf6824cc2fc..eafd571d70563942f133e63fcf93f1602ad6c513 100644 (file)
 #   The format should be transport://user:pass@host1:port[,hostN:portN]/virtual_host
 #   Defaults to $::os_service_default.
 #
+# [*batch_size*]
+#   (Optional) Number of notification messages to wait before publishing
+#   them.
+#   Defaults to $::os_service_default.
+#
+# [*batch_timeout*]
+#   (Optional) Number of seconds to wait before dispatching samples when
+#   batch_size is not reached.
+#   Defaults to $::os_service_default.
+#
 # [*package_ensure*]
 #   (Optional) ensure state for package.
 #   Defaults to 'present'.
@@ -90,6 +100,8 @@ class ceilometer::agent::notification (
   $disable_non_metric_meters = $::os_service_default,
   $workers                   = $::os_service_default,
   $messaging_urls            = $::os_service_default,
+  $batch_size                = $::os_service_default,
+  $batch_timeout             = $::os_service_default,
   $package_ensure            = 'present',
   $manage_event_pipeline     = false,
   $event_pipeline_publishers = ['gnocchi://'],
@@ -172,5 +184,7 @@ class ceilometer::agent::notification (
     'notification/disable_non_metric_meters': value => $disable_non_metric_meters;
     'notification/workers'                  : value => $workers;
     'notification/messaging_urls'           : value => $messaging_urls, secret => true;
+    'notification/batch_size'               : value => $batch_size;
+    'notification/batch_timeout'            : value => $batch_timeout;
   }
 }
diff --git a/releasenotes/notes/notification-batch-opts-c9284092587ca561.yaml b/releasenotes/notes/notification-batch-opts-c9284092587ca561.yaml
new file mode 100644 (file)
index 0000000..f952ca0
--- /dev/null
@@ -0,0 +1,5 @@
+---
+features:
+  - |
+    The ``ceilometer::agent::notification`` class now supports the
+    ``batch_size`` parameter and the ``batch_timeout`` parameter.
index 16bc8112b4e102898537630a15604b1a5a92ffa7..681375c8bb9109b0b87759b7b689f160007932f4 100644 (file)
@@ -48,6 +48,8 @@ describe 'ceilometer::agent::notification' do
       is_expected.to contain_ceilometer_config('notification/workers').with_value('<SERVICE DEFAULT>')
       is_expected.to contain_ceilometer_config('notification/ack_on_event_error').with_value('<SERVICE DEFAULT>')
       is_expected.to contain_ceilometer_config('notification/disable_non_metric_meters').with_value('<SERVICE DEFAULT>')
+      is_expected.to contain_ceilometer_config('notification/batch_size').with_value('<SERVICE DEFAULT>')
+      is_expected.to contain_ceilometer_config('notification/batch_timeout').with_value('<SERVICE DEFAULT>')
     end
 
     context 'with disabled non-metric meters' do