From cb4bdcb9f2f646e0b1ba413d08c69fefde882ada Mon Sep 17 00:00:00 2001 From: VoronM1522 <118175360+VoronM1522@users.noreply.github.com> Date: Thu, 27 Feb 2025 00:48:45 +0300 Subject: [PATCH] Update app.py --- app_python/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app_python/app.py b/app_python/app.py index c42e1c424..2bdbaf4e4 100644 --- a/app_python/app.py +++ b/app_python/app.py @@ -11,7 +11,7 @@ # Prometheus metrics REQUEST_COUNT = Counter('app_request_count', 'Total number of requests') -REQUEST_TIME = Gauge('app_request_time_seconds', +REQUEST_TIME = Gauge('app_request_time_seconds', 'Time spent processing requests') ERROR_COUNT = Counter('app_error_count', 'Total number of errors') @@ -47,7 +47,7 @@ def current_time() -> str: time = datetime.now(TIME_ZONE) REQUEST_COUNT.inc() # Increment request counter - REQUEST_TIME.set((datetime.now() - \ + REQUEST_TIME.set((datetime.now() - start_time).total_seconds()) # Set request time return f"Current time in {TIME_ZONE} is {time.strftime('%H:%M:%S')}"