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:
@@ -162,6 +162,13 @@ class BackpressureHandler:
|
|||||||
self.last_data_message_time = time.time()
|
self.last_data_message_time = time.time()
|
||||||
|
|
||||||
def start_backpressure_monitor(self) -> Thread:
|
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
|
# Start the Backpressure monitor loop
|
||||||
self.thread = Thread(target=self.backpressure_monitor_loop)
|
self.thread = Thread(target=self.backpressure_monitor_loop)
|
||||||
self.thread.daemon = True # This makes it a daemon thread
|
self.thread.daemon = True # This makes it a daemon thread
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ class Backpressure:
|
|||||||
self.idle_duration = config.getint(
|
self.idle_duration = config.getint(
|
||||||
"CleverMicro-AMQ", self.PREFIX + "idle-duration", fallback=30
|
"CleverMicro-AMQ", self.PREFIX + "idle-duration", fallback=30
|
||||||
)
|
)
|
||||||
|
# Flag to enable/disable CPU monitoring
|
||||||
|
self.cpu_monitoring_enabled = config.getboolean(
|
||||||
|
"CleverMicro-AMQ", self.PREFIX + "cpu-monitoring-enabled", fallback=False
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AMQConfiguration:
|
class AMQConfiguration:
|
||||||
|
|||||||
Reference in New Issue
Block a user