Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to limit the send queue length #950

Merged
merged 6 commits into from Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/plugins/filecount.pp
Expand Up @@ -7,11 +7,11 @@
},
}

collectd::plugin::filecount::directory { 'foodir':
collectd::plugin::filecount::directory {'foodir':
bastelfreak marked this conversation as resolved.
Show resolved Hide resolved
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
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[0]] $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
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
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