Skip to content

Commit ce3d6b7

Browse files
authored
Restrict scheduling seconds (#86)
* Do not run heartbeats during fastchecks * Don't schedule too early or too late in the minute
1 parent 7c3ff08 commit ce3d6b7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

dynatrace_extension/__about__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
#
33
# SPDX-License-Identifier: MIT
44

5-
__version__ = "1.2.11"
5+
6+
__version__ = "1.2.12"

dynatrace_extension/sdk/callback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ def name(self):
8989
def initial_wait_time(self) -> float:
9090
if not self.running_in_sim:
9191
"""
92-
Here we chose a random second between 1 and 59 to start the callback
92+
Here we chose a random second between 5 and 55 to start the callback
9393
This is to distribute load for extension running on this host
9494
When running from the simulator, this is not done
9595
"""
9696

9797
now = self.get_current_time_with_cluster_diff()
98-
random_second = random.randint(1, 59) # noqa: S311
98+
random_second = random.randint(5, 55) # noqa: S311
9999
next_execution = datetime.now().replace(second=random_second, microsecond=0)
100100
if next_execution <= now:
101101
# The random chosen second already passed this minute

0 commit comments

Comments
 (0)