MCPcopy
hub / github.com/prometheus/prometheus / readTestdataFile

Function readTestdataFile

model/textparse/benchmark_test.go:253–265  ·  view source on GitHub ↗
(tb testing.TB, file string)

Source from the content-addressed store, hash-verified

251}
252
253func readTestdataFile(tb testing.TB, file string) []byte {
254 tb.Helper()
255
256 f, err := os.Open(filepath.Join("testdata", file))
257 require.NoError(tb, err)
258
259 tb.Cleanup(func() {
260 _ = f.Close()
261 })
262 buf, err := io.ReadAll(f)
263 require.NoError(tb, err)
264 return buf
265}
266
267/*
268 export bench=v1 && go test ./model/textparse/... \

Callers 4

BenchmarkParsePromTextFunction · 0.85
BenchmarkParseOMTextFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…