Skip to content

Commit

Permalink
Alarm: record history support
Browse files Browse the repository at this point in the history
Ceilometer Alarm is able to record alarm change events.
This patch add this support in manifest.

Change-Id: Id8ece03dfd3491cd2886a345771df9622d702190
Signed-off-by: Emilien Macchi <[email protected]>
(cherry picked from commit 24a7125)
  • Loading branch information
Emilien Macchi committed Dec 8, 2013
1 parent 8dd62be commit dd60a1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/alarm/evaluator.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
# define which service use for the evaluator
# [*partition_rpc_topic*]
# define which topic the alarm evaluator should access
# [*record_history*]
# Record alarm change events
#
class ceilometer::alarm::evaluator (
$enabled = true,
$evaluation_interval = 60,
$evaluation_service = 'ceilometer.alarm.service.SingletonAlarmService',
$partition_rpc_topic = 'alarm_partition_coordination',
$record_history = true,
) {

include ceilometer::params
Expand Down Expand Up @@ -52,5 +55,6 @@
'alarm/evaluation_interval' : value => $evaluation_interval;
'alarm/evaluation_service' : value => $evaluation_service;
'alarm/partition_rpc_topic' : value => $partition_rpc_topic;
'alarm/record_history' : value => $record_history;
}
}
4 changes: 4 additions & 0 deletions spec/classes/ceilometer_alarm_evaluator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{ :evaluation_interval => 60,
:evaluation_service => 'ceilometer.alarm.service.SingletonAlarmService',
:partition_rpc_topic => 'alarm_partition_coordination',
:record_history => true,
:enabled => true,
}
end
Expand Down Expand Up @@ -46,16 +47,19 @@
should contain_ceilometer_config('alarm/evaluation_interval').with_value( params[:evaluation_interval] )
should contain_ceilometer_config('alarm/evaluation_service').with_value( params[:evaluation_service] )
should contain_ceilometer_config('alarm/partition_rpc_topic').with_value (params[:partition_rpc_topic] )
should contain_ceilometer_config('alarm/record_history').with_value (params[:record_history] )
end

context 'when overriding parameters' do
before do
params.merge!(:evaluation_interval => 80,
:partition_rpc_topic => 'alarm_partition_coordination',
:record_history => false,
:evaluation_service => 'ceilometer.alarm.service.SingletonTestAlarmService')
end
it { should contain_ceilometer_config('alarm/evaluation_interval').with_value(params[:evaluation_interval]) }
it { should contain_ceilometer_config('alarm/evaluation_service').with_value(params[:evaluation_service]) }
it { should contain_ceilometer_config('alarm/record_history').with_value(params[:record_history]) }
it { should contain_ceilometer_config('alarm/partition_rpc_topic').with_value(params[:partition_rpc_topic]) }
end

Expand Down

0 comments on commit dd60a1f

Please sign in to comment.