ResourceMonitor#
- class pyedb.workflows.job_manager.backend.service.ResourceMonitor(update_interval: int = 5)#
Async background task that samples host telemetry every N seconds.
The monitor keeps a thread-safe in-memory cache used by
JobPoolManager.can_start_job()to throttle submissions.- Parameters:
- update_interval
int,optional Sampling period in seconds. Default is
5.
- update_interval
- Attributes:
- current_usage
dict Cached resource usage information with keys: - cpu_percent: Current CPU usage percentage - memory_percent: Current memory usage percentage - memory_used_gb: Memory used in GB - memory_total_gb: Total memory in GB - memory_free_gb: Free memory in GB - disk_usage_percent: Disk usage percentage - disk_free_gb: Free disk space in GB - timestamp: Last update timestamp
- current_usage
Overview#
Infinite coroutine that updates |
Import detail#
from pyedb.workflows.job_manager.backend.service import ResourceMonitor
Attribute detail#
- ResourceMonitor.update_interval = 5#
- ResourceMonitor.current_usage#
Method detail#
- async ResourceMonitor.monitor_resources()#
Infinite coroutine that updates
current_usage.Runs until the event-loop is shut down. Samples CPU, memory, and disk usage at regular intervals.