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

Function TestStatsTracker_GetUsersStats

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

Source from the content-addressed store, hash-verified

65}
66
67func TestStatsTracker_GetUsersStats(t *testing.T) {
68 tracker := New()
69 ctx := context.Background()
70
71 updateSample(tracker, "key1", "user1@example.com", 1000, 2000, "1.2.3.4")
72 updateSample(tracker, "key2", "user2@example.com", 3000, 4000, "1.2.3.5")
73
74 resp := tracker.GetUsersStats(ctx, false)
75 if len(resp.Stats) != 4 {
76 t.Fatalf("Expected 4 stats, got %d", len(resp.Stats))
77 }
78}
79
80func TestStatsTracker_RemoveStatsMarksDeletedAndKeepsDeltaUntilReset(t *testing.T) {
81 tracker := New()

Callers

nothing calls this directly

Calls 3

updateSampleFunction · 0.85
NewFunction · 0.70
GetUsersStatsMethod · 0.45

Tested by

no test coverage detected