Merge "Migrate evaluation_interval to [evaluator]"
This commit is contained in:
commit
d880ff2cb2
@ -215,8 +215,10 @@ class AlarmEvaluationService(cotyledon.Service):
|
|||||||
# allow time for coordination if necessary
|
# allow time for coordination if necessary
|
||||||
delay_start = self.partition_coordinator.is_active()
|
delay_start = self.partition_coordinator.is_active()
|
||||||
|
|
||||||
|
evaluation_interval = self.conf.evaluator.evaluation_interval
|
||||||
|
|
||||||
if self.evaluators:
|
if self.evaluators:
|
||||||
@periodics.periodic(spacing=self.conf.evaluation_interval,
|
@periodics.periodic(spacing=evaluation_interval,
|
||||||
run_immediately=not delay_start)
|
run_immediately=not delay_start)
|
||||||
def evaluate_alarms():
|
def evaluate_alarms():
|
||||||
self._evaluate_assigned_alarms()
|
self._evaluate_assigned_alarms()
|
||||||
@ -225,7 +227,7 @@ class AlarmEvaluationService(cotyledon.Service):
|
|||||||
|
|
||||||
if self.partition_coordinator.is_active():
|
if self.partition_coordinator.is_active():
|
||||||
heartbeat_interval = min(self.conf.coordination.heartbeat_interval,
|
heartbeat_interval = min(self.conf.coordination.heartbeat_interval,
|
||||||
self.conf.evaluation_interval / 4)
|
evaluation_interval / 4)
|
||||||
|
|
||||||
@periodics.periodic(spacing=heartbeat_interval,
|
@periodics.periodic(spacing=heartbeat_interval,
|
||||||
run_immediately=True)
|
run_immediately=True)
|
||||||
@ -288,7 +290,7 @@ class AlarmEvaluationService(cotyledon.Service):
|
|||||||
|
|
||||||
def _assigned_alarms(self):
|
def _assigned_alarms(self):
|
||||||
before = (timeutils.utcnow() - datetime.timedelta(
|
before = (timeutils.utcnow() - datetime.timedelta(
|
||||||
seconds=self.conf.evaluation_interval / 2))
|
seconds=self.conf.evaluator.evaluation_interval / 2))
|
||||||
selected = self.storage_conn.get_alarms(
|
selected = self.storage_conn.get_alarms(
|
||||||
enabled=True,
|
enabled=True,
|
||||||
type={'ne': 'event'},
|
type={'ne': 'event'},
|
||||||
|
@ -41,11 +41,6 @@ OPTS = [
|
|||||||
'effect.'),
|
'effect.'),
|
||||||
help='Timeout seconds for HTTP requests. Set it to None to '
|
help='Timeout seconds for HTTP requests. Set it to None to '
|
||||||
'disable timeout.'),
|
'disable timeout.'),
|
||||||
cfg.IntOpt('evaluation_interval',
|
|
||||||
default=60,
|
|
||||||
help='Period of evaluation cycle, should'
|
|
||||||
' be >= than configured pipeline interval for'
|
|
||||||
' collection of underlying meters.'),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
EVALUATOR_OPTS = [
|
EVALUATOR_OPTS = [
|
||||||
@ -53,7 +48,13 @@ EVALUATOR_OPTS = [
|
|||||||
default=1,
|
default=1,
|
||||||
min=1,
|
min=1,
|
||||||
help='Number of workers for evaluator service. '
|
help='Number of workers for evaluator service. '
|
||||||
'default value is 1.')
|
'default value is 1.'),
|
||||||
|
cfg.IntOpt('evaluation_interval',
|
||||||
|
default=60,
|
||||||
|
deprecated_group='DEFAULT',
|
||||||
|
help='Period of evaluation cycle, should'
|
||||||
|
' be >= than configured pipeline interval for'
|
||||||
|
' collection of underlying meters.'),
|
||||||
]
|
]
|
||||||
|
|
||||||
NOTIFIER_OPTS = [
|
NOTIFIER_OPTS = [
|
||||||
|
@ -66,7 +66,8 @@ class TestAlarmEvaluationService(tests_base.BaseTestCase):
|
|||||||
coordination_active=False):
|
coordination_active=False):
|
||||||
|
|
||||||
self.CONF.set_override('evaluation_interval',
|
self.CONF.set_override('evaluation_interval',
|
||||||
test_interval)
|
test_interval,
|
||||||
|
group='evaluator')
|
||||||
self.CONF.set_override('heartbeat_interval',
|
self.CONF.set_override('heartbeat_interval',
|
||||||
coordination_heartbeat_interval,
|
coordination_heartbeat_interval,
|
||||||
group='coordination')
|
group='coordination')
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The ``[DEFAULT] evaluation_interval`` parameter has been migrated to
|
||||||
|
the ``[evaluator]`` section. The old parameter is still kept for backword
|
||||||
|
compatibility but will be removed in a future release.
|
Loading…
x
Reference in New Issue
Block a user