From 75c2f0dfe4cc5125235b6fe457df059a44ccd92c Mon Sep 17 00:00:00 2001 From: UserIsMH Date: Sat, 21 Jun 2025 22:57:18 +0200 Subject: [PATCH] Monitoring fix --- v2_adminpanel/routes/monitoring_routes.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/v2_adminpanel/routes/monitoring_routes.py b/v2_adminpanel/routes/monitoring_routes.py index 36ee35d..193eeb8 100644 --- a/v2_adminpanel/routes/monitoring_routes.py +++ b/v2_adminpanel/routes/monitoring_routes.py @@ -93,7 +93,7 @@ def unified_monitoring(): COUNT(*) as total_validations, COUNT(DISTINCT hardware_id) as unique_devices, COUNT(DISTINCT ip_address) as unique_ips, - AVG(CASE WHEN response_time IS NOT NULL THEN response_time ELSE 0 END) as avg_response_time + 0 as avg_response_time FROM license_heartbeats WHERE timestamp > NOW() - INTERVAL '5 minutes' """) @@ -239,12 +239,11 @@ def unified_monitoring(): cur.execute(""" SELECT DATE_TRUNC('minute', timestamp) as minute, - AVG(response_time) as avg_response_time, - MAX(response_time) as max_response_time, + 0 as avg_response_time, + 0 as max_response_time, COUNT(*) as request_count FROM license_heartbeats WHERE timestamp > NOW() - INTERVAL '30 minutes' - AND response_time IS NOT NULL GROUP BY minute ORDER BY minute DESC """) @@ -282,7 +281,7 @@ def unified_monitoring(): except Exception as e: logger.error(f"Error in unified monitoring: {str(e)}") return render_template('error.html', - error_message='Fehler beim Laden des Monitorings', + error='Fehler beim Laden des Monitorings', details=str(e)) @monitoring_bp.route('/live-dashboard') @@ -382,7 +381,7 @@ def analytics(): except Exception as e: logger.error(f"Error in analytics: {str(e)}") return render_template('error.html', - error_message='Fehler beim Laden der Analytics', + error='Fehler beim Laden der Analytics', details=str(e))