MCPcopy Create free account
hub / github.com/diillson/chatcli / AddSnapshot

Method AddSnapshot

k8s/store.go:37–45  ·  view source on GitHub ↗

AddSnapshot adds a resource snapshot to the store.

(snap ResourceSnapshot)

Source from the content-addressed store, hash-verified

35
36// AddSnapshot adds a resource snapshot to the store.
37func (s *ObservabilityStore) AddSnapshot(snap ResourceSnapshot) {
38 s.mu.Lock()
39 defer s.mu.Unlock()
40
41 s.snapshots = append(s.snapshots, snap)
42 if len(s.snapshots) > s.maxSnapshots {
43 s.snapshots = s.snapshots[1:]
44 }
45}
46
47// AddLogs adds log entries to the store.
48func (s *ObservabilityStore) AddLogs(entries []LogEntry) {

Callers 15

makeHealthyStoreFunction · 0.95
makeWarningStoreFunction · 0.95
makeCriticalStoreFunction · 0.95
TestAddSnapshotFunction · 0.95
TestGetRestartTrendFunction · 0.95
TestStatsFunction · 0.95

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by 15

makeHealthyStoreFunction · 0.76
makeWarningStoreFunction · 0.76
makeCriticalStoreFunction · 0.76
TestAddSnapshotFunction · 0.76
TestGetRestartTrendFunction · 0.76
TestStatsFunction · 0.76