Implement bad connections baseline reset functionality
Publish telemt-api gateway Docker image / test (push) Successful in 9s
Publish telemt-api gateway Docker image / build-and-push (push) Successful in 2m1s

- 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:
Denozordec
2026-04-12 13:30:56 +07:00
parent ea2ecb44d2
commit d1095081bc
8 changed files with 233 additions and 4 deletions
+5
View File
@@ -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).