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

Function TestComputeTotal

internal/report/report_test.go:394–510  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

392}
393
394func TestComputeTotal(t *testing.T) {
395 p1 := testProfile.Copy()
396 p1.Sample = []*profile.Sample{
397 {
398 Location: []*profile.Location{testL[0]},
399 Value: []int64{1, 1},
400 },
401 {
402 Location: []*profile.Location{testL[2], testL[1], testL[0]},
403 Value: []int64{1, 10},
404 },
405 {
406 Location: []*profile.Location{testL[4], testL[2], testL[0]},
407 Value: []int64{1, 100},
408 },
409 }
410
411 p2 := testProfile.Copy()
412 p2.Sample = []*profile.Sample{
413 {
414 Location: []*profile.Location{testL[0]},
415 Value: []int64{1, 1},
416 },
417 {
418 Location: []*profile.Location{testL[2], testL[1], testL[0]},
419 Value: []int64{1, -10},
420 },
421 {
422 Location: []*profile.Location{testL[4], testL[2], testL[0]},
423 Value: []int64{1, 100},
424 },
425 }
426
427 p3 := testProfile.Copy()
428 p3.Sample = []*profile.Sample{
429 {
430 Location: []*profile.Location{testL[0]},
431 Value: []int64{10000, 1},
432 },
433 {
434 Location: []*profile.Location{testL[2], testL[1], testL[0]},
435 Value: []int64{-10, 3},
436 Label: map[string][]string{"pprof::base": {"true"}},
437 },
438 {
439 Location: []*profile.Location{testL[2], testL[1], testL[0]},
440 Value: []int64{1000, -10},
441 },
442 {
443 Location: []*profile.Location{testL[2], testL[1], testL[0]},
444 Value: []int64{-9000, 3},
445 Label: map[string][]string{"pprof::base": {"true"}},
446 },
447 {
448 Location: []*profile.Location{testL[2], testL[1], testL[0]},
449 Value: []int64{-1, 3},
450 Label: map[string][]string{"pprof::base": {"true"}},
451 },

Callers

nothing calls this directly

Calls 2

computeTotalFunction · 0.85
CopyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…