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

Function TestNewStat_Memory

internal/utils/cachehits/stat_test.go:72–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestNewStat_Memory(t *testing.T) {
73 if !testutils.IsSingleTesting() {
74 return
75 }
76
77 var stat = cachehits.NewStat(20)
78 for i := 0; i < 10_000_000; i++ {
79 stat.IncreaseCached("a" + types.String(i))
80 }
81
82 time.Sleep(60 * time.Second)
83
84 t.Log(stat.Len())
85}
86
87func BenchmarkStat(b *testing.B) {
88 runtime.GOMAXPROCS(4)

Callers

nothing calls this directly

Calls 6

IsSingleTestingFunction · 0.92
NewStatFunction · 0.92
IncreaseCachedMethod · 0.80
LogMethod · 0.80
StringMethod · 0.45
LenMethod · 0.45

Tested by

no test coverage detected