From cf24d2c25e78ec3578f7d3ef200764a16d3c48b3 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 8 May 2024 18:37:06 +0000 Subject: [PATCH] check_send_receive_time: Use time.perf_counter() for duration timing. --- .../nagios_plugins/zulip_app_frontend/check_send_receive_time | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time index 0562853bc4..e7c6a1cc4b 100755 --- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time +++ b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time @@ -125,7 +125,7 @@ try: except Exception: report("CRITICAL", msg=f"Error subscribing to Zulips:\n{traceback.format_exc()}") msg_to_send = str(random.getrandbits(64)) -time_start = time.time() +time_start = time.perf_counter() send_zulip( zulip_sender, @@ -141,7 +141,7 @@ msg_content: List[str] = [] while msg_to_send not in msg_content: messages = get_zulips() - seconds_diff = time.time() - time_start + seconds_diff = time.perf_counter() - time_start msg_content = [m["content"] for m in messages]