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

Function TestCounter_GC

internal/utils/counters/counter_test.go:45–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestCounter_GC(t *testing.T) {
46 if !testutils.IsSingleTesting() {
47 return
48 }
49
50 var counter = counters.NewCounter[uint32]()
51 counter.Increase(1, 20)
52 time.Sleep(1 * time.Second)
53 counter.Increase(1, 20)
54 time.Sleep(1 * time.Second)
55 counter.Increase(1, 20)
56 counter.GC()
57 t.Log(counter.Get(1))
58}
59
60func TestCounter_GC2(t *testing.T) {
61 if !testutils.IsSingleTesting() {

Callers

nothing calls this directly

Calls 5

IsSingleTestingFunction · 0.92
LogMethod · 0.80
GCMethod · 0.65
IncreaseMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected