feat: add toggle for CPU monitoring in backpressure handler

Co-authored-by: aider (openrouter/openai/o3-mini-high) <aider@aider.chat>
This commit is contained in:
Stanislav Hejny
2025-07-11 23:38:01 +01:00
parent 5075f510e9
commit 3150dc9907
2 changed files with 11 additions and 0 deletions
+7
View File
@@ -162,6 +162,13 @@ class BackpressureHandler:
self.last_data_message_time = time.time()
def start_backpressure_monitor(self) -> Thread:
# Check if CPU monitoring is enabled in configuration
cpu_monitoring_enabled = self.config.backpressure.cpu_monitoring_enabled
if not cpu_monitoring_enabled:
logging_info("Backpressure CPU monitoring is disabled by configuration")
return None
# Start the Backpressure monitor loop
self.thread = Thread(target=self.backpressure_monitor_loop)
self.thread.daemon = True # This makes it a daemon thread