diff --git a/modules/nats/internal/keeper/keeper_test.go b/modules/nats/internal/keeper/keeper_test.go index b638e8557..9d936d2ad 100644 --- a/modules/nats/internal/keeper/keeper_test.go +++ b/modules/nats/internal/keeper/keeper_test.go @@ -737,7 +737,7 @@ func TestTheKeeperMakesWhatAVerdictAsksForAndSaysIt(t *testing.T) { t.Fatalf("the drop's record: %+v", got) } findings := k.Finding.(*findingLog) - if fmt.Sprint(findings.calls) != "[write nats.snapshots.snapshots-filling nats]" { + if fmt.Sprint(findings.calls) != "[write module.nats.snapshots.snapshots-filling nats]" { t.Errorf("100 of 120 bytes is 83%%, so the finding is written through the held writer: %v", findings.calls) } // Another snapshot of 100 bytes would pass the cap: refused, its file removed, nothing deleted from the bus. @@ -754,7 +754,7 @@ func TestTheKeeperMakesWhatAVerdictAsksForAndSaysIt(t *testing.T) { findings.calls = nil k.ExpireSnapshots() if _, _, found, _ := store.Get(StateRequests, "r10"); found || fmt.Sprint(files.removed) != "[/snapshots/m_log.tar /snapshots/KV_m_drafts.tar]" || - len(journal) != 1 || !strings.Contains(journal[0], "past its 90 days") || fmt.Sprint(findings.calls) != "[clear nats.snapshots.snapshots-filling]" { + len(journal) != 1 || !strings.Contains(journal[0], "past its 90 days") || fmt.Sprint(findings.calls) != "[clear module.nats.snapshots.snapshots-filling]" { t.Errorf("after 91 days: removed %v, journal %v, finding calls %v", files.removed, journal, findings.calls) } if _, _, found, _ := store.Get(StateRequests, "r0"); !found { diff --git a/modules/nats/internal/keeper/snapshots.go b/modules/nats/internal/keeper/snapshots.go index 7f4132c1c..6a52d1d9a 100644 --- a/modules/nats/internal/keeper/snapshots.go +++ b/modules/nats/internal/keeper/snapshots.go @@ -29,7 +29,7 @@ const ( // FindingSnapshotsFilling is the finding's kind; its scope is the bus module and its id SnapshotsID. FindingSnapshotsFilling = "snapshots-filling" // SnapshotsID is the id of the finding `snapshots-filling`. - SnapshotsID = "snapshots" + SnapshotsID = "nats.snapshots" ) // Findings is the bus module's finding writer, a held writer of mesh-sdk (views.HeldWriter): the keeper writes and clears @@ -275,7 +275,7 @@ func (k *Keeper) snapshotsFill(used int64) { ctx := context.Background() switch { case now: - f := meshconditions.Finding{Scope: Module, ID: SnapshotsID, Kind: FindingSnapshotsFilling, + f := meshconditions.Finding{Scope: "module", ID: SnapshotsID, Kind: FindingSnapshotsFilling, Subject: meshconditions.Subject{Scope: "module", ID: Module}, Severity: meshconditions.FindingSeverityWarning, Headline: "The bus module's snapshots are filling up", Summary: fmt.Sprintf("the snapshots hold %d of %d bytes (%d%%)", used, capBytes, pct), @@ -287,7 +287,7 @@ func (k *Keeper) snapshotsFill(used int64) { k.logf("the finding %s cannot be written: %v", FindingSnapshotsFilling, err) } case was || unjudged: - if err := k.Finding.Clear(ctx, Module, SnapshotsID, FindingSnapshotsFilling, "the snapshots are under 80 % of their cap"); err != nil { + if err := k.Finding.Clear(ctx, "module", SnapshotsID, FindingSnapshotsFilling, "the snapshots are under 80 % of their cap"); err != nil { k.logf("the finding %s cannot be cleared: %v", FindingSnapshotsFilling, err) } }