(t *testing.T)
| 247 | } |
| 248 | |
| 249 | func TestTable_Count(t *testing.T) { |
| 250 | var table = testOpenStoreTable[*testCachedItem](t, "cache_items", &testCacheItemEncoder[*testCachedItem]{}) |
| 251 | |
| 252 | defer func() { |
| 253 | _ = testingStore.Close() |
| 254 | }() |
| 255 | |
| 256 | var before = time.Now() |
| 257 | count, err := table.Count() |
| 258 | if err != nil { |
| 259 | t.Fatal(err) |
| 260 | } |
| 261 | var costSeconds = time.Since(before).Seconds() |
| 262 | t.Log("count:", count, "cost:", costSeconds*1000, "ms", "qps:", fmt.Sprintf("%.2fM/s", float64(count)/costSeconds/1_000_000)) |
| 263 | |
| 264 | // watch memory usage |
| 265 | if testutils.IsSingleTesting() { |
| 266 | //time.Sleep(5 * time.Minute) |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | func TestTable_Truncate(t *testing.T) { |
| 271 | var table = testOpenStoreTable[*testCachedItem](t, "cache_items", &testCacheItemEncoder[*testCachedItem]{}) |
nothing calls this directly
no test coverage detected