MCPcopy Create free account
hub / github.com/PasarGuard/node / TestStatsTracker_ClearAllStats

Function TestStatsTracker_ClearAllStats

pkg/stats/tracker_test.go:110–121  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestStatsTracker_ClearAllStats(t *testing.T) {
111 tracker := New()
112 ctx := context.Background()
113
114 updateSample(tracker, "key1", "user1@example.com", 1000, 2000, "1.2.3.4")
115 tracker.ClearAllStats()
116
117 resp := tracker.GetUsersStats(ctx, false)
118 if len(resp.Stats) != 0 {
119 t.Errorf("Expected 0 stats after clear, got %d", len(resp.Stats))
120 }
121}
122
123func TestStatsTracker_RemoveStatsEntryDeletedOnReset(t *testing.T) {
124 tracker := New()

Callers

nothing calls this directly

Calls 4

updateSampleFunction · 0.85
ClearAllStatsMethod · 0.80
NewFunction · 0.70
GetUsersStatsMethod · 0.45

Tested by

no test coverage detected