Browse Source

Allow to configure evaluation interval

This change allows to change the period of alarm evaluation cycle.

Change-Id: I0d6ffe6b2682dc94c4252727c0a42c53c22ccbd2
changes/17/482817/1
Mehdi Abaakouk 5 years ago
parent
commit
131a8be8be
  1. 16
      manifests/evaluator.pp
  2. 10
      spec/classes/aodh_evaluator_spec.rb

16
manifests/evaluator.pp

@ -17,16 +17,24 @@
# (optional) The url to use for distributed group membership coordination.
# Defaults to undef.
#
# [*evaluation_interval*]
# (optional) Period of evaluation cycle
# Defaults to $::os_service_default.
#
class aodh::evaluator (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$coordination_url = undef,
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$coordination_url = undef,
$evaluation_interval = $::os_service_default,
) {
include ::aodh::deps
include ::aodh::params
aodh_config {
'DEFAULT/evaluation_interval' : value => $evaluation_interval;
}
if $coordination_url {
aodh_config {
'coordination/backend_url' : value => $coordination_url;

10
spec/classes/aodh_evaluator_spec.rb

@ -29,6 +29,16 @@ describe 'aodh::evaluator' do
end
end
context 'with evaluation interval' do
before do
params.merge!({ :evaluation_interval => '10' })
end
it 'configures interval' do
is_expected.to contain_aodh_config('DEFAULT/evaluation_interval').with_value('10')
end
end
context 'when enabled' do
it { is_expected.to contain_class('aodh::params') }

Loading…
Cancel
Save