Add support for metric_cleanup_delay option

metric_cleanup_delay option is useful to configure the number of seconds
to wait between cleaning of expired data.

Change-Id: I8d2fccb0cef49246b3c15b0942ba6067519cee1f
This commit is contained in:
Emilien Macchi 2017-07-04 13:40:12 -07:00
parent e3347d7731
commit 1accdde363
2 changed files with 18 additions and 1 deletions

View File

@ -14,6 +14,11 @@
# (optional) the number of workers. # (optional) the number of workers.
# Defaults to $::os_workers # Defaults to $::os_workers
# #
# [*cleanup_delay*]
# (optional) How many seconds to wait between
# cleaning of expired data.
# Defaults to $::os_service_default
#
# [*manage_service*] # [*manage_service*]
# (optional) Whether the service should be managed by Puppet. # (optional) Whether the service should be managed by Puppet.
# Defaults to true. # Defaults to true.
@ -22,13 +27,15 @@ class gnocchi::metricd (
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,
$workers = $::os_workers, $workers = $::os_workers,
$cleanup_delay = $::os_service_default,
$package_ensure = 'present', $package_ensure = 'present',
) inherits gnocchi::params { ) inherits gnocchi::params {
include ::gnocchi::deps include ::gnocchi::deps
gnocchi_config { gnocchi_config {
'metricd/workers': value => $workers; 'metricd/workers': value => $workers;
'metricd/metric_cleanup_delay': value => $cleanup_delay;
} }
package { 'gnocchi-metricd': package { 'gnocchi-metricd':

View File

@ -65,6 +65,16 @@ describe 'gnocchi::metricd' do
is_expected.to contain_gnocchi_config('metricd/workers').with_value('2') is_expected.to contain_gnocchi_config('metricd/workers').with_value('2')
end end
end end
context 'with cleanup_delay set' do
before do
params.merge!({
:cleanup_delay => 30 })
end
it 'configures gnocchi metricd cleanup_delay value' do
is_expected.to contain_gnocchi_config('metricd/metric_cleanup_delay').with_value('30')
end
end
end end
on_supported_os({ on_supported_os({