Fixed stdin buffer length in context

This commit is contained in:
Niels Geens
2024-11-14 13:36:20 +01:00
parent 834ce12e8f
commit 325870a81a
6 changed files with 27 additions and 16 deletions

View File

@@ -69,7 +69,7 @@ class SystemMetrics:
time.sleep(self._sample_interval)
def generate_context(self, context_usage: float) -> ET.Element:
def generate_context(self, context_usage: float, stdin_buffer_length: int) -> ET.Element:
"""
Generate XML context element with current system metrics.
Clears usage samples after generating averages.
@@ -112,7 +112,7 @@ class SystemMetrics:
context.set("context_usage", str(round(context_usage * 100)))
# Standard input buffer size
context.set("stdin", "0") # Set by agent
context.set("stdin", stdin_buffer_length)
return context