MCPcopy Index your code
hub / github.com/prometheus/prometheus / newTestScrapePool

Function newTestScrapePool

scrape/helpers_test.go:143–162  ·  view source on GitHub ↗
(t *testing.T, app compatAppendable, appV2 bool, injectNewLoop func(options scrapeLoopOptions) loop)

Source from the content-addressed store, hash-verified

141}
142
143func newTestScrapePool(t *testing.T, app compatAppendable, appV2 bool, injectNewLoop func(options scrapeLoopOptions) loop) *scrapePool {
144 sa := selectAppendable(app, appV2)
145 return &scrapePool{
146 ctx: t.Context(),
147 cancel: func() {},
148 logger: promslog.NewNopLogger(),
149 config: &config.ScrapeConfig{},
150 options: &Options{},
151 client: http.DefaultClient,
152
153 activeTargets: map[uint64]*Target{},
154 loops: map[uint64]loop{},
155 injectTestNewLoop: injectNewLoop,
156
157 appendable: sa.V1(), appendableV2: sa.V2(),
158
159 symbolTable: labels.NewSymbolTable(),
160 metrics: newTestScrapeMetrics(t),
161 }
162}
163
164// protoMarshalDelimited marshals a MetricFamily into a delimited
165// Prometheus proto exposition format bytes (known as `encoding=delimited`)

Calls 6

NewSymbolTableFunction · 0.92
selectAppendableFunction · 0.85
newTestScrapeMetricsFunction · 0.85
V1Method · 0.80
V2Method · 0.80
ContextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…