Skip to content

Commit

Permalink
Merge 9f098b8 into 3daaf69
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunge authored Jul 23, 2020
2 parents 3daaf69 + 9f098b8 commit 0b1bde3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
1 change: 0 additions & 1 deletion examples/plugins/ceph.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
osds => [ 'osd.0', 'osd.1', 'osd.2'],
}


4 changes: 2 additions & 2 deletions examples/plugins/filecount.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
},
}

collectd::plugin::filecount::directory {'foodir':
collectd::plugin::filecount::directory { 'foodir':
path => '/path/to/dir',
}

collectd::plugin::filecount::directory {'aborted-uploads':
collectd::plugin::filecount::directory { 'aborted-uploads':
path => '/var/spool/foo/upload',
pattern => '.part.*',
mtime => '5m',
Expand Down
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 0b1bde3

Please sign in to comment.