From 414330b3d57c01cc8c10a9328d4b89dddeb6aa1e Mon Sep 17 00:00:00 2001 From: marcsello Date: Mon, 26 Jul 2021 17:07:55 +0200 Subject: [PATCH] Lowered warning tresholds --- src/magic_ampq.py | 8 ++++---- src/resources.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/magic_ampq.py b/src/magic_ampq.py index fc5cb95..805ad63 100644 --- a/src/magic_ampq.py +++ b/src/magic_ampq.py @@ -53,7 +53,7 @@ class MagicAMPQ: lock_start = time.time() with self._lock: lock_acquire_time = time.time() - lock_start - if lock_acquire_time >= 1.5: + if lock_acquire_time >= 0.5: self.app.logger.warning(f"Loop: Lock acquire took {lock_acquire_time:5f} sec") try: @@ -64,7 +64,7 @@ class MagicAMPQ: self._reconnect_ampq() total_time = time.time() - lock_start - if total_time > 2: + if total_time > 1: self.app.logger.warning(f"Loop: Total loop took {total_time:5f} sec") def publish(self, payload=None): @@ -75,7 +75,7 @@ class MagicAMPQ: lock_start = time.time() with self._lock: lock_acquire_time = time.time() - lock_start - if lock_acquire_time >= 0.3: + if lock_acquire_time >= 0.2: self.app.logger.warning(f"Publish: Lock acquire took {lock_acquire_time:5f} sec") tries = 0 while True: @@ -106,7 +106,7 @@ class MagicAMPQ: if tries > 10: time.sleep(2) total_time = time.time() - lock_start - if total_time > 0.5: + if total_time > 0.4: self.app.logger.warning(f"Publish: Total publish took {total_time:5f} sec") def is_healthy(self) -> bool: diff --git a/src/resources.py b/src/resources.py index 0c45aeb..6586b3e 100644 --- a/src/resources.py +++ b/src/resources.py @@ -100,7 +100,7 @@ class SampleResource(Resource): ) upload_time = time.time() - upload_started - if upload_time > 0.9: + if upload_time > 0.8: current_app.logger.warning(f"Uploading to storage-service took {upload_time:5} sec") if r.status_code not in [200, 201]: