From 833f9c873d538037d6036624d19e5cba332cf54a Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Thu, 5 Sep 2019 19:44:20 -0700 Subject: Adjusted default heartbeat interval and renamed file The current default for heartbeats is a little aggressive, adjusting the default value from 5s to 10s. Also fixed the name of the conf file to make it clearer. Change-Id: I3a699e9c83fab7851636867ef7399fa5fa9c3761 --- designate/conf/__init__.py | 4 +-- designate/conf/heartbeat_emitter.py | 38 +++++++++++++++++++++++++++++ designate/conf/service_status.py | 38 ----------------------------- designate/tests/unit/test_service_status.py | 2 +- 4 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 designate/conf/heartbeat_emitter.py delete mode 100644 designate/conf/service_status.py diff --git a/designate/conf/__init__.py b/designate/conf/__init__.py index 5c402980..439c0ddc 100644 --- a/designate/conf/__init__.py +++ b/designate/conf/__init__.py @@ -24,6 +24,7 @@ from designate.conf import denominator from designate.conf import djbdns from designate.conf import dynect from designate.conf import gdnsd +from designate.conf import heartbeat_emitter from designate.conf import infoblox from designate.conf import keystone from designate.conf import knot2 @@ -34,7 +35,6 @@ from designate.conf import network_api from designate.conf import pool_manager from designate.conf import producer from designate.conf import proxy -from designate.conf import service_status from designate.conf import sink from designate.conf import storage from designate.conf import worker @@ -52,6 +52,7 @@ denominator.register_opts(CONF) djbdns.register_opts(CONF) dynect.register_opts(CONF) gdnsd.register_opts(CONF) +heartbeat_emitter.register_opts(CONF) infoblox.register_opts(CONF) keystone.register_opts(CONF) knot2.register_opts(CONF) @@ -62,7 +63,6 @@ network_api.register_opts(CONF) pool_manager.register_opts(CONF) producer.register_opts(CONF) proxy.register_opts(CONF) -service_status.register_opts(CONF) sink.register_opts(CONF) storage.register_opts(CONF) worker.register_opts(CONF) diff --git a/designate/conf/heartbeat_emitter.py b/designate/conf/heartbeat_emitter.py new file mode 100644 index 00000000..1d9f4e57 --- /dev/null +++ b/designate/conf/heartbeat_emitter.py @@ -0,0 +1,38 @@ +# Copyright 2016 Hewlett Packard Enterprise Development Company LP +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +from oslo_config import cfg + +HEARTBEAT_GROUP = cfg.OptGroup( + name='heartbeat_emitter', + title="Configuration for heartbeat_emitter" +) + +HEARTBEAT_OPTS = [ + cfg.FloatOpt('heartbeat_interval', + default=10.0, + help='Number of seconds between heartbeats for reporting ' + 'state'), + cfg.StrOpt('emitter_type', default="rpc", help="Emitter to use"), +] + + +def register_opts(conf): + conf.register_group(HEARTBEAT_GROUP) + conf.register_opts(HEARTBEAT_OPTS, group=HEARTBEAT_GROUP) + + +def list_opts(): + return { + HEARTBEAT_GROUP: HEARTBEAT_OPTS + } diff --git a/designate/conf/service_status.py b/designate/conf/service_status.py deleted file mode 100644 index d43afec6..00000000 --- a/designate/conf/service_status.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2016 Hewlett Packard Enterprise Development Company LP -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from oslo_config import cfg - -HEARTBEAT_GROUP = cfg.OptGroup( - name='heartbeat_emitter', - title="Configuration for heartbeat_emitter" -) - -HEARTBEAT_OPTS = [ - cfg.FloatOpt('heartbeat_interval', - default=5.0, - help='Number of seconds between heartbeats for reporting ' - 'state'), - cfg.StrOpt('emitter_type', default="rpc", help="Emitter to use"), -] - - -def register_opts(conf): - conf.register_group(HEARTBEAT_GROUP) - conf.register_opts(HEARTBEAT_OPTS, group=HEARTBEAT_GROUP) - - -def list_opts(): - return { - HEARTBEAT_GROUP: HEARTBEAT_OPTS - } diff --git a/designate/tests/unit/test_service_status.py b/designate/tests/unit/test_service_status.py index 6ad43942..a8fe3880 100644 --- a/designate/tests/unit/test_service_status.py +++ b/designate/tests/unit/test_service_status.py @@ -32,7 +32,7 @@ class NoopEmitterTest(oslotest.base.BaseTestCase): emitter.start() self.mock_tg.add_timer.assert_called_once_with( - 5.0, emitter._emit_heartbeat) + 10.0, emitter._emit_heartbeat) def test_stop(self): mock_pulse = mock.Mock() -- cgit v1.2.1