Skip to content

Commit

Permalink
Merge 0b6a991 into 9ed582f
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunge committed Jul 31, 2020
2 parents 9ed582f + 0b6a991 commit f75ff36
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
27 changes: 16 additions & 11 deletions manifests/plugin/amqp1.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
# before attempting to reconnect.
# Defaults to 1
#
# [*send_queue_limit*]
# Limits the SentQueue to a defined value, helps to keep memory usage low
# when the write target does not respond.
#
# [*interval*]
# Interval setting for the plugin
# Defaults to undef
Expand Down Expand Up @@ -100,17 +104,18 @@
# preserved, i.e. passed through.
#
class collectd::plugin::amqp1 (
Enum['present', 'absent'] $ensure = 'present',
Boolean $manage_package = $collectd::manage_package,
String $transport = 'metrics',
Stdlib::Host $host = 'localhost',
Stdlib::Port $port = 5672,
String $user = 'guest',
String $password = 'guest',
String $address = 'collectd',
Hash $instances = {},
Optional[Integer] $retry_delay = undef,
Optional[Integer] $interval = undef,
Enum['present', 'absent'] $ensure = 'present',
Boolean $manage_package = $collectd::manage_package,
String $transport = 'metrics',
Stdlib::Host $host = 'localhost',
Stdlib::Port $port = 5672,
String $user = 'guest',
String $password = 'guest',
String $address = 'collectd',
Hash $instances = {},
Optional[Integer] $retry_delay = undef,
Optional[Integer] $send_queue_limit = undef,
Optional[Integer] $interval = undef,
) {

include collectd
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/collectd_plugin_amqp1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
password: 'password',
address: 'address',
retry_delay: 30,
send_queue_limit: 40,
instances: {
instance: {
format: 'JSON',
Expand All @@ -68,6 +69,7 @@
it { is_expected.to contain_file('amqp1.load').with(content: %r{Password "password"}) }
it { is_expected.to contain_file('amqp1.load').with(content: %r{Address "address"}) }
it { is_expected.to contain_file('amqp1.load').with(content: %r{RetryDelay 30}) }
it { is_expected.to contain_file('amqp1.load').with(content: %r{SendQueueLimit 40}) }
it { is_expected.to contain_file('amqp1.load').with(content: %r{<Instance "instance">}) }
it { is_expected.to contain_file('amqp1.load').with(content: %r{Format "JSON"}) }
it { is_expected.to contain_file('amqp1.load').with(content: %r{PreSettle true}) }
Expand Down
3 changes: 3 additions & 0 deletions templates/plugin/amqp1.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<% unless $::collectd::plugin::amqp1::retry_delay =~ Undef { -%>
RetryDelay <%= $::collectd::plugin::amqp1::retry_delay %>
<% } -%>
<% unless $::collectd::plugin::amqp1::send_queue_limit =~ Undef { -%>
SendQueueLimit <%= $::collectd::plugin::amqp1::send_queue_limit %>
<% } -%>
<% $::collectd::plugin::amqp1::instances.keys.sort.each |$name| { -%>
<Instance "<%= $name %>">
<% $::collectd::plugin::amqp1::instances[$name].keys.sort.each |$key| { -%>
Expand Down

0 comments on commit f75ff36

Please sign in to comment.