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

Function TestNormalizeByDifferentProfile

profile/profile_test.go:1015–1037  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1013}
1014
1015func TestNormalizeByDifferentProfile(t *testing.T) {
1016 p := testProfile1.Copy()
1017 pb := testProfile2.Copy()
1018
1019 if err := p.Normalize(pb); err != nil {
1020 t.Fatal(err)
1021 }
1022
1023 expectedSampleValues := [][]int64{
1024 {20, 1000},
1025 {2, 100},
1026 {199, 10000},
1027 {0, 1},
1028 }
1029
1030 for i, s := range p.Sample {
1031 for j, v := range s.Value {
1032 if v != expectedSampleValues[i][j] {
1033 t.Errorf("For sample %d, value %d want %d got %d", i, j, expectedSampleValues[i][j], v)
1034 }
1035 }
1036 }
1037}
1038
1039func TestNormalizeByMultipleOfSameProfile(t *testing.T) {
1040 pb := testProfile1.Copy()

Callers

nothing calls this directly

Calls 2

CopyMethod · 0.80
NormalizeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…