feat: add proxy and statistics features
This commit is contained in:
@ -22,6 +22,7 @@ type AgentState struct {
|
||||
Volumes []*agentv1.VolumeInfo
|
||||
Networks []*agentv1.NetworkInfo
|
||||
|
||||
Stats *agentv1.StatsSnapshot
|
||||
cmdCh chan *agentv1.ServerMessage
|
||||
pendingFiles map[string]chan *agentv1.FileResult
|
||||
pendingUpdates map[string]string // commandID → containerID
|
||||
@ -102,6 +103,15 @@ func (r *Registry) UpdateResources(id string, containers []*agentv1.ContainerInf
|
||||
}
|
||||
}
|
||||
|
||||
func (r *Registry) UpdateStats(id string, stats *agentv1.StatsSnapshot) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
if s, ok := r.agents[id]; ok {
|
||||
s.Stats = stats
|
||||
s.LastSeenAt = time.Now()
|
||||
}
|
||||
}
|
||||
|
||||
// UpdateAlias refreshes the alias for a live agent (called after an admin update).
|
||||
func (r *Registry) UpdateAlias(id, alias string) {
|
||||
r.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user