feat(agent): add ProbeManager with ICMP/TCP/HTTP probes and handlers

Implements the core probe execution engine (ProbeManager) that runs
network probes on configurable intervals, collects latency samples,
and aggregates results over a 60s sliding window. Adds two new
WebSocket handlers (SyncNetworkProbes, GetNetworkProbeResults) for
hub-agent communication and integrates probe lifecycle into the agent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
xiaomiku01
2026-04-11 00:26:02 +08:00
parent a42d899e64
commit 865e6db90f
5 changed files with 306 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ func (c *ConnectionManager) Start(serverOptions ServerOptions) error {
case <-sigCtx.Done():
slog.Info("Shutting down", "cause", context.Cause(sigCtx))
_ = c.agent.StopServer()
c.agent.probeManager.Stop()
c.closeWebSocket()
return health.CleanUp()
}