MCPcopy Index your code
hub / github.com/netdata/netdata / TestPrometheusReadFromFile

Function TestPrometheusReadFromFile

src/go/pkg/prometheus/client_test.go:114–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestPrometheusReadFromFile(t *testing.T) {
115 req := web.RequestConfig{URL: "file://testdata/testdata.txt"}
116
117 prom := NewWithSelector(http.DefaultClient, req, nil)
118
119 for range 2 {
120 res, err := prom.ScrapeSeries()
121 assert.NoError(t, err)
122 verifyTestData(t, res)
123 }
124
125 prom = New(http.DefaultClient, req)
126
127 for range 2 {
128 res, err := prom.ScrapeSeries()
129 assert.NoError(t, err)
130 verifyTestData(t, res)
131 }
132}
133
134func verifyTestData(t *testing.T, ms Series) {
135 assert.Equal(t, 410, len(ms))

Callers

nothing calls this directly

Calls 4

NewWithSelectorFunction · 0.85
verifyTestDataFunction · 0.85
NewFunction · 0.70
ScrapeSeriesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…