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

Function TestTable_Count

internal/utils/kvstore/table_test.go:249–268  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func 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
270func TestTable_Truncate(t *testing.T) {
271 var table = testOpenStoreTable[*testCachedItem](t, "cache_items", &testCacheItemEncoder[*testCachedItem]{})

Callers

nothing calls this directly

Calls 4

IsSingleTestingFunction · 0.92
LogMethod · 0.80
CloseMethod · 0.65
CountMethod · 0.65

Tested by

no test coverage detected