MCPcopy Create free account
hub / github.com/google/pprof / TestFetchWithBase

Function TestFetchWithBase

internal/driver/fetch_test.go:249–574  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func TestFetchWithBase(t *testing.T) {
250 baseConfig := currentConfig()
251 defer setCurrentConfig(baseConfig)
252
253 type WantSample struct {
254 values []int64
255 labels map[string][]string
256 }
257
258 const path = "testdata/"
259 type testcase struct {
260 desc string
261 sources []string
262 bases []string
263 diffBases []string
264 normalize bool
265 wantSamples []WantSample
266 wantParseErrorMsg string
267 wantFetchErrorMsg string
268 }
269
270 testcases := []testcase{
271 {
272 "not normalized base is same as source",
273 []string{path + "cppbench.contention"},
274 []string{path + "cppbench.contention"},
275 nil,
276 false,
277 nil,
278 "",
279 "",
280 },
281 {
282 "not normalized base is same as source",
283 []string{path + "cppbench.contention"},
284 []string{path + "cppbench.contention"},
285 nil,
286 false,
287 nil,
288 "",
289 "",
290 },
291 {
292 "not normalized single source, multiple base (all profiles same)",
293 []string{path + "cppbench.contention"},
294 []string{path + "cppbench.contention", path + "cppbench.contention"},
295 nil,
296 false,
297 []WantSample{
298 {
299 values: []int64{-2700, -608881724},
300 labels: map[string][]string{},
301 },
302 {
303 values: []int64{-100, -23992},
304 labels: map[string][]string{},
305 },
306 {

Callers

nothing calls this directly

Calls 6

NewFunction · 0.92
currentConfigFunction · 0.85
setCurrentConfigFunction · 0.85
setDefaultsFunction · 0.85
parseFlagsFunction · 0.85
fetchProfilesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…