Rename [coordination] heartbeat to hearbeat_interval

... so that users can more easily understnad the parameter defines
interval. This makes the parameter name consistent with other services
like designate or mistral, which provides the similar functionality
using the same tooz library.

Change-Id: I53cf905d7f643a3dc41f1121404abe3c9f0e61ac
This commit is contained in:
Takashi Kajinami 2021-07-06 17:13:45 +09:00
parent 8404e9ac74
commit 1948461d95
4 changed files with 14 additions and 6 deletions

View File

@ -32,8 +32,9 @@ OPTS = [
'left empty, alarm evaluation won\'t do workload '
'partitioning and will only function correctly if a '
'single instance of the service is running.'),
cfg.FloatOpt('heartbeat',
cfg.FloatOpt('heartbeat_interval',
default=1.0,
deprecated_name='heartbeat',
help='Number of seconds between heartbeats for distributed '
'coordination.'),
cfg.FloatOpt('check_watchers',

View File

@ -224,7 +224,7 @@ class AlarmEvaluationService(cotyledon.Service):
self.periodic.add(evaluate_alarms)
if self.partition_coordinator.is_active():
heartbeat_interval = min(self.conf.coordination.heartbeat,
heartbeat_interval = min(self.conf.coordination.heartbeat_interval,
self.conf.evaluation_interval / 4)
@periodics.periodic(spacing=heartbeat_interval,

View File

@ -62,13 +62,13 @@ class TestAlarmEvaluationService(tests_base.BaseTestCase):
))
def _do_test_start(self, test_interval=120,
coordination_heartbeat=1.0,
coordination_heartbeat_interval=1.0,
coordination_active=False):
self.CONF.set_override('evaluation_interval',
test_interval)
self.CONF.set_override('heartbeat',
coordination_heartbeat,
self.CONF.set_override('heartbeat_interval',
coordination_heartbeat_interval,
group='coordination')
self._fake_pc.is_active.return_value = coordination_active
@ -88,7 +88,7 @@ class TestAlarmEvaluationService(tests_base.BaseTestCase):
def test_start_coordinated_high_hb_interval(self):
self._do_test_start(coordination_active=True, test_interval=10,
coordination_heartbeat=5)
coordination_heartbeat_interval=5)
def test_evaluation_cycle(self):
alarm = mock.Mock(type='gnocchi_aggregation_by_metrics_threshold',

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
The ``[coordination] heartbeat`` parameter has been renamed to
the ``[coordination] heartbeat_interval``.
The old ``[coordination] heartbeat`` parameter is deprecated and will be
removed in a future release.