MCPcopy
hub / github.com/grafana/tempo / fillCache

Function fillCache

pkg/cache/background_test.go:29–47  ·  pkg/cache/background_test.go::fillCache
(cache cache.Cache)

Source from the content-addressed store, hash-verified

27}
28
29func fillCache(cache cache.Cache) ([]string, [][]byte) {
30 // put a set of chunks, larger than background batch size, with varying timestamps and values
31 keys := []string{}
32 bufs := [][]byte{}
33 for i := 0; i < 111; i++ {
34
35 buf := make([]byte, rand.Intn(100))
36 _, err := crand.Read(buf)
37 if err != nil {
38 panic(err)
39 }
40
41 keys = append(keys, strconv.Itoa(i))
42 bufs = append(bufs, buf)
43 }
44
45 cache.Store(context.Background(), keys, bufs)
46 return keys, bufs
47}
48
49func testCacheSingle(t *testing.T, cache cache.Cache, keys []string, bufs [][]byte) {
50 for i := 0; i < 100; i++ {

Callers 1

TestBackgroundFunction · 0.85

Calls 2

ReadMethod · 0.65
StoreMethod · 0.65

Tested by

no test coverage detected