Monitoring fix
Dieser Commit ist enthalten in:
@@ -93,7 +93,7 @@ def unified_monitoring():
|
|||||||
COUNT(*) as total_validations,
|
COUNT(*) as total_validations,
|
||||||
COUNT(DISTINCT hardware_id) as unique_devices,
|
COUNT(DISTINCT hardware_id) as unique_devices,
|
||||||
COUNT(DISTINCT ip_address) as unique_ips,
|
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
|
FROM license_heartbeats
|
||||||
WHERE timestamp > NOW() - INTERVAL '5 minutes'
|
WHERE timestamp > NOW() - INTERVAL '5 minutes'
|
||||||
""")
|
""")
|
||||||
@@ -239,12 +239,11 @@ def unified_monitoring():
|
|||||||
cur.execute("""
|
cur.execute("""
|
||||||
SELECT
|
SELECT
|
||||||
DATE_TRUNC('minute', timestamp) as minute,
|
DATE_TRUNC('minute', timestamp) as minute,
|
||||||
AVG(response_time) as avg_response_time,
|
0 as avg_response_time,
|
||||||
MAX(response_time) as max_response_time,
|
0 as max_response_time,
|
||||||
COUNT(*) as request_count
|
COUNT(*) as request_count
|
||||||
FROM license_heartbeats
|
FROM license_heartbeats
|
||||||
WHERE timestamp > NOW() - INTERVAL '30 minutes'
|
WHERE timestamp > NOW() - INTERVAL '30 minutes'
|
||||||
AND response_time IS NOT NULL
|
|
||||||
GROUP BY minute
|
GROUP BY minute
|
||||||
ORDER BY minute DESC
|
ORDER BY minute DESC
|
||||||
""")
|
""")
|
||||||
@@ -282,7 +281,7 @@ def unified_monitoring():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error in unified monitoring: {str(e)}")
|
logger.error(f"Error in unified monitoring: {str(e)}")
|
||||||
return render_template('error.html',
|
return render_template('error.html',
|
||||||
error_message='Fehler beim Laden des Monitorings',
|
error='Fehler beim Laden des Monitorings',
|
||||||
details=str(e))
|
details=str(e))
|
||||||
|
|
||||||
@monitoring_bp.route('/live-dashboard')
|
@monitoring_bp.route('/live-dashboard')
|
||||||
@@ -382,7 +381,7 @@ def analytics():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error in analytics: {str(e)}")
|
logger.error(f"Error in analytics: {str(e)}")
|
||||||
return render_template('error.html',
|
return render_template('error.html',
|
||||||
error_message='Fehler beim Laden der Analytics',
|
error='Fehler beim Laden der Analytics',
|
||||||
details=str(e))
|
details=str(e))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren