From 3d6ba923bf42f1e0a4f9fbeff42fde44c5af9bf7 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Tue, 22 Aug 2023 21:55:03 -0600 Subject: [PATCH] stats: track proompters over last minute rather than average --- llm_server/routes/stats.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llm_server/routes/stats.py b/llm_server/routes/stats.py index 78fd9ef..8e8a004 100644 --- a/llm_server/routes/stats.py +++ b/llm_server/routes/stats.py @@ -23,8 +23,12 @@ class SemaphoreCheckerThread(Thread): def run(self): global proompters_1_min while True: - self.values.append(opts.concurrent_gens - concurrent_semaphore._value) - proompters_1_min = sum(self.values) / len(self.values) + # If the semaphore value is less than the maximum, a prompter has sent a prompt + if opts.concurrent_gens > self.semaphore._value: + self.values.append(1) + else: + self.values.append(0) + proompters_1_min = sum(self.values) time.sleep(1)