(b *testing.B)
| 138 | } |
| 139 | |
| 140 | func BenchmarkGetFromMemory(b *testing.B) { |
| 141 | c := newMemoryCache() |
| 142 | defer c.Close() |
| 143 | testData := c.TestDataSlice[0].(*memoryUser) |
| 144 | iCache := c.ICache.(Cache) |
| 145 | |
| 146 | key := utils.Uint64ToStr(testData.ID) |
| 147 | err := iCache.Set(c.Ctx, key, c.TestDataMap[key], time.Minute) |
| 148 | if err != nil { |
| 149 | b.Error(err) |
| 150 | return |
| 151 | } |
| 152 | |
| 153 | for i := 0; i < b.N; i++ { |
| 154 | val := &memoryUser{} |
| 155 | _ = iCache.Get(c.Ctx, key, val) |
| 156 | } |
| 157 | } |
nothing calls this directly
no test coverage detected