Added tests and readme

This commit is contained in:
2026-05-12 06:20:51 +00:00
parent 7e85bb0fcc
commit 139c224a31
23 changed files with 1449 additions and 97 deletions
-11
View File
@@ -99,17 +99,6 @@ func (a *Aggregator) Submit(nodeID string, r Result) {
a.evaluate(r.CheckID)
}
// SnapshotAll returns the current aggregate view of every known check.
func (a *Aggregator) SnapshotAll() map[string]Snapshot {
a.mu.Lock()
defer a.mu.Unlock()
out := make(map[string]Snapshot, len(a.perCheck))
for id, st := range a.perCheck {
out[id] = a.snapshotLocked(id, st)
}
return out
}
// SnapshotFor returns the aggregate for a single check.
func (a *Aggregator) SnapshotFor(checkID string) (Snapshot, bool) {
a.mu.Lock()