-
- Downloads
Fixed resource monitoring
... | @@ -342,8 +342,10 @@ def _monitor_worker( | ... | @@ -342,8 +342,10 @@ def _monitor_worker( |
ra.acc() # guarantees at least an entry will be available | ra.acc() # guarantees at least an entry will be available | ||
if summary_event.is_set(): | if summary_event.is_set(): | ||
queue.put(ra.summary()) | summary = ra.summary().copy() | ||
|
|||
queue.put(summary) | |||
ra.clear() | ra.clear() | ||
print(queue.get()) | |||
|
|||
summary_event.clear() | summary_event.clear() | ||
time.sleep(interval) | time.sleep(interval) | ||
... | @@ -416,7 +418,6 @@ class ResourceMonitor: | ... | @@ -416,7 +418,6 @@ class ResourceMonitor: |
"""Forces the monitoring process to yield data and clear the internal | """Forces the monitoring process to yield data and clear the internal | ||
accumlator.""" | accumlator.""" | ||
self.summary_event.set() | self.summary_event.set() | ||
try: | try: | ||
data: dict[str, list[int | float]] = self.q.get( | data: dict[str, list[int | float]] = self.q.get( | ||
timeout=2 * self.interval | timeout=2 * self.interval | ||
... | ... |