(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestCounter_GC2(t *testing.T) { |
| 61 | if !testutils.IsSingleTesting() { |
| 62 | return |
| 63 | } |
| 64 | |
| 65 | var counter = counters.NewCounter[uint32]().WithGC() |
| 66 | for i := 0; i < 100_000; i++ { |
| 67 | counter.Increase(uint64(i), rands.Int(10, 300)) |
| 68 | } |
| 69 | |
| 70 | var ticker = time.NewTicker(1 * time.Second) |
| 71 | for range ticker.C { |
| 72 | t.Log(timeutil.Format("H:i:s"), counter.TotalItems()) |
| 73 | if counter.TotalItems() == 0 { |
| 74 | break |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func TestCounterMemory(t *testing.T) { |
| 80 | var stat = &runtime.MemStats{} |
nothing calls this directly
no test coverage detected