MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestDAUManager_AddIP_Many

Function TestDAUManager_AddIP_Many

internal/stats/dau_manager_test.go:39–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestDAUManager_AddIP_Many(t *testing.T) {
40 var manager = stats.NewDAUManager()
41 err := manager.Init()
42 if err != nil {
43 t.Fatal(err)
44 }
45
46 var before = time.Now()
47 defer func() {
48 t.Log("cost:", time.Since(before).Seconds()*1000, "ms")
49 }()
50
51 var count = 1
52
53 if testutils.IsSingleTesting() {
54 count = 10_000
55 }
56
57 for i := 0; i < count; i++ {
58 manager.AddIP(int64(rands.Int(1, 10)), testutils.RandIP())
59 }
60}
61
62func TestDAUManager_CleanStats(t *testing.T) {
63 var manager = stats.NewDAUManager()

Callers

nothing calls this directly

Calls 6

NewDAUManagerFunction · 0.92
IsSingleTestingFunction · 0.92
RandIPFunction · 0.92
LogMethod · 0.80
InitMethod · 0.65
AddIPMethod · 0.45

Tested by

no test coverage detected