MCPcopy
hub / github.com/grafana/dskit / GetMultiWithError

Method GetMultiWithError

cache/tracing.go:50–63  ·  view source on GitHub ↗
(ctx context.Context, keys []string, opts ...Option)

Source from the content-addressed store, hash-verified

48}
49
50func (t *SpanlessTracingCache) GetMultiWithError(ctx context.Context, keys []string, opts ...Option) (result map[string][]byte, err error) {
51 var (
52 bytes int
53 logger = spanlogger.FromContext(ctx, t.logger, t.resolver)
54 )
55 result, err = t.next.GetMultiWithError(ctx, keys, opts...)
56
57 for _, v := range result {
58 bytes += len(v)
59 }
60 level.Debug(logger).Log("msg", "cache_fetch", "name", t.Name(), "requested keys", len(keys), "returned keys", len(result), "returned bytes", bytes)
61
62 return
63}
64
65func (t *SpanlessTracingCache) Name() string {
66 return t.next.Name()

Callers 1

GetMultiMethod · 0.95

Calls 4

NameMethod · 0.95
FromContextFunction · 0.92
GetMultiWithErrorMethod · 0.65
LogMethod · 0.45

Tested by

no test coverage detected