Merge "Support more [metricd] parameters"
This commit is contained in:
commit
5a3035d9eb
@ -14,34 +14,65 @@
|
||||
# (optional) the number of workers.
|
||||
# Defaults to $::os_workers
|
||||
#
|
||||
# [*cleanup_delay*]
|
||||
# (optional) How many seconds to wait between
|
||||
# cleaning of expired data.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*metric_processing_delay*]
|
||||
# (optional) Delay between processng metrics
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*greedy*]
|
||||
# (optional) Allow to bypass metric_processing_delay if metricd is noticed
|
||||
# that messages are ready to be processed.
|
||||
# Defaoults to $::os_service_default.
|
||||
#
|
||||
# [*metric_reporting_delay*]
|
||||
# (optional) How many seocnds to wait between metric ingestion reporting.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*metric_cleanup_delay*]
|
||||
# (optional) How many seconds to wait between cleaning of expired data.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*processing_replicas*]
|
||||
# (optional) Number of workers tht share a task.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) Whether the service should be managed by Puppet.
|
||||
# Defaults to true.
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*cleanup_delay*]
|
||||
# (optional) How many seconds to wait between
|
||||
# cleaning of expired data.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
class gnocchi::metricd (
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$workers = $::os_workers,
|
||||
$metric_processing_delay = $::os_service_default,
|
||||
$cleanup_delay = $::os_service_default,
|
||||
$greedy = $::os_service_default,
|
||||
$metric_reporting_delay = $::os_service_default,
|
||||
$metric_cleanup_delay = $::os_service_default,
|
||||
$processing_replicas = $::os_service_default,
|
||||
$package_ensure = 'present',
|
||||
# DEPRECATED PARAMETERS
|
||||
$cleanup_delay = undef,
|
||||
) inherits gnocchi::params {
|
||||
|
||||
include gnocchi::deps
|
||||
|
||||
if $cleanup_delay != undef {
|
||||
warning('The cleanup_delay parameter is deprecated. Use metric_cleanup_delay instead')
|
||||
}
|
||||
|
||||
gnocchi_config {
|
||||
'metricd/workers': value => $workers;
|
||||
'metricd/metric_cleanup_delay': value => $cleanup_delay;
|
||||
'metricd/metric_processing_delay': value => $metric_processing_delay;
|
||||
'metricd/greedy': value => $greedy;
|
||||
'metricd/metric_reporting_delay': value => $metric_reporting_delay;
|
||||
'metricd/metric_cleanup_delay': value => pick($cleanup_delay, $metric_cleanup_delay);
|
||||
'metricd/processing_replicas': value => $processing_replicas;
|
||||
}
|
||||
|
||||
package { 'gnocchi-metricd':
|
||||
|
13
releasenotes/notes/metricd-opts-78c846cee9222e7d.yaml
Normal file
13
releasenotes/notes/metricd-opts-78c846cee9222e7d.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The following parameters have been added to the ``gnocchi::metricd`` class.
|
||||
|
||||
- ``greedy``
|
||||
- ``metric_reporting_delay``
|
||||
- ``processing_replicas``
|
||||
|
||||
deprecations:
|
||||
- |
|
||||
The ``gnocchi::metricd::cleanup_delay`` parameter has been deprecated in
|
||||
favor of the new ``gnocchi::metricd::metric_cleanup_delay`` parameter.
|
@ -18,6 +18,15 @@ describe 'gnocchi::metricd' do
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures the default value' do
|
||||
is_expected.to contain_gnocchi_config('metricd/workers').with_value(4)
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_processing_delay').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_gnocchi_config('metricd/greedy').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_reporting_delay').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_cleanup_delay').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_gnocchi_config('metricd/processing_replicas').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
[{:enabled => true}, {:enabled => false}].each do |param_hash|
|
||||
context "when service should be #{param_hash[:enabled] ? 'enabled' : 'disabled'}" do
|
||||
before do
|
||||
@ -56,33 +65,25 @@ describe 'gnocchi::metricd' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with workers set' do
|
||||
context 'with parameters set' do
|
||||
before do
|
||||
params.merge!({
|
||||
:workers => 2 })
|
||||
:workers => 2,
|
||||
:metric_processing_delay => 60,
|
||||
:greedy => true,
|
||||
:metric_reporting_delay => 120,
|
||||
:metric_cleanup_delay => 300,
|
||||
:processing_replicas => 3,
|
||||
})
|
||||
end
|
||||
it 'configures gnocchi metricd worker value' do
|
||||
is_expected.to contain_gnocchi_config('metricd/workers').with_value('2')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with metric delay set' do
|
||||
before do
|
||||
params.merge!({
|
||||
:metric_processing_delay => 15 })
|
||||
end
|
||||
it 'configures gnocchi metricd processing delay value' do
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_processing_delay').with_value('15')
|
||||
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')
|
||||
it 'configures the overridden value' do
|
||||
is_expected.to contain_gnocchi_config('metricd/workers').with_value(2)
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_processing_delay').with_value(60)
|
||||
is_expected.to contain_gnocchi_config('metricd/greedy').with_value(true)
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_reporting_delay').with_value(120)
|
||||
is_expected.to contain_gnocchi_config('metricd/metric_cleanup_delay').with_value(300)
|
||||
is_expected.to contain_gnocchi_config('metricd/processing_replicas').with_value(3)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -92,7 +93,7 @@ describe 'gnocchi::metricd' do
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
facts.merge!(OSDefaults.get_facts({ :os_workers => 4 }))
|
||||
end
|
||||
|
||||
let(:platform_params) do
|
||||
|
Loading…
Reference in New Issue
Block a user