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

Function newStoreWithLogger

modules/backendworker/backendworker_test.go:180–207  ·  view source on GitHub ↗
(ctx context.Context, t testing.TB, log log.Logger, tmpDir string)

Source from the content-addressed store, hash-verified

178}
179
180func newStoreWithLogger(ctx context.Context, t testing.TB, log log.Logger, tmpDir string) storage.Store {
181 s, err := storage.NewStore(storage.Config{
182 Trace: tempodb.Config{
183 Backend: backend.Local,
184 Local: &local.Config{
185 Path: tmpDir + "/traces",
186 },
187 Block: &common.BlockConfig{
188 BloomFP: 0.01,
189 BloomShardSizeBytes: 100_000,
190 Version: encoding.LatestEncoding().Version(),
191 },
192 WAL: &wal.Config{
193 Filepath: tmpDir + "/wal",
194 },
195 BlocklistPoll: 100 * time.Millisecond,
196 },
197 }, nil, log)
198 require.NoError(t, err)
199
200 s.EnablePolling(ctx, &ownsEverythingSharder{}, false)
201
202 t.Cleanup(func() {
203 s.StopAsync()
204 require.NoError(t, s.AwaitTerminated(context.Background()))
205 })
206 return s
207}
208
209func cutTestBlocks(t testing.TB, w tempodb.Writer, tenantID string, blockCount int, recordCount int) []common.BackendBlock {
210 blocks := make([]common.BackendBlock, 0)

Callers 1

newStoreFunction · 0.70

Calls 4

NewStoreFunction · 0.92
LatestEncodingFunction · 0.92
VersionMethod · 0.65
EnablePollingMethod · 0.65

Tested by

no test coverage detected