Implement bad connections baseline reset functionality
- Added a new field `badConnBaseline` in the `Handler` struct to store the baseline for bad connections. - Updated the `BuildIncidents` function to utilize the effective bad connections count for incident generation. - Introduced a new API endpoint `/api/agg/bad-connections/reset` to reset the bad connections baseline. - Enhanced the frontend with a button to trigger the reset action, providing user feedback through toast notifications. - Updated Svelte components to handle the reset functionality and display appropriate messages based on the operation's success or failure.
This commit is contained in:
@@ -33,6 +33,11 @@ type Handler struct {
|
||||
|
||||
cacheMu sync.Mutex
|
||||
cache map[string]cacheEntry
|
||||
|
||||
// badConnBaseline хранит снимок connections_bad_total на момент сброса в UI;
|
||||
// инциденты bad_connections_* считаются по приросту от этой отметки (в памяти процесса шлюза).
|
||||
badConnBaselineMu sync.Mutex
|
||||
badConnBaseline map[string]uint64
|
||||
}
|
||||
|
||||
// ResolveAliasesForLive resolves aliases for external endpoints (SSE/live).
|
||||
|
||||
Reference in New Issue
Block a user