MCPcopy
hub / github.com/prometheus/prometheus / createTestAgentDB

Function createTestAgentDB

tsdb/agent/db_test.go:92–105  ·  view source on GitHub ↗
(t testing.TB, reg prometheus.Registerer, opts *Options)

Source from the content-addressed store, hash-verified

90}
91
92func createTestAgentDB(t testing.TB, reg prometheus.Registerer, opts *Options) *DB {
93 t.Helper()
94
95 dbDir := t.TempDir()
96
97 rs := remote.NewStorage(promslog.NewNopLogger(), reg, startTime, dbDir, time.Second*30, nil, false)
98 t.Cleanup(func() {
99 require.NoError(t, rs.Close())
100 })
101
102 db, err := Open(promslog.NewNopLogger(), reg, rs, dbDir, opts)
103 require.NoError(t, err)
104 return db
105}
106
107// TestConcurrentAppendSameLabels verifies that concurrent appends for the same
108// label set produce exactly one series in memory and one series record in the WAL.

Callers 15

TestDB_InvalidSeriesFunction · 0.85
TestUnsupportedFunctionsFunction · 0.85
TestCommitFunction · 0.85
TestRollbackFunction · 0.85
TestFullTruncateWALFunction · 0.85
TestPartialTruncateWALFunction · 0.85
TestWALReplayFunction · 0.85
TestDBAllowOOOSamplesFunction · 0.85

Calls 3

CloseMethod · 0.95
NewStorageFunction · 0.92
OpenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…