From aafabb9605973556e3f01f86bbb364ced6d1604d Mon Sep 17 00:00:00 2001 From: dcarron <daniel.carron@idiap.ch> Date: Wed, 12 Jul 2023 19:30:48 +0200 Subject: [PATCH] Fixed resource monitoring --- src/ptbench/utils/resources.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ptbench/utils/resources.py b/src/ptbench/utils/resources.py index f7c7f6b9..bda05f20 100644 --- a/src/ptbench/utils/resources.py +++ b/src/ptbench/utils/resources.py @@ -342,8 +342,10 @@ def _monitor_worker( ra.acc() # guarantees at least an entry will be available if summary_event.is_set(): - queue.put(ra.summary()) + summary = ra.summary().copy() + queue.put(summary) ra.clear() + print(queue.get()) summary_event.clear() time.sleep(interval) @@ -416,7 +418,6 @@ class ResourceMonitor: """Forces the monitoring process to yield data and clear the internal accumlator.""" self.summary_event.set() - try: data: dict[str, list[int | float]] = self.q.get( timeout=2 * self.interval -- GitLab