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

Function TestNormalizeByMultipleOfSameProfile

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

Source from the content-addressed store, hash-verified

1037}
1038
1039func TestNormalizeByMultipleOfSameProfile(t *testing.T) {
1040 pb := testProfile1.Copy()
1041 for i, s := range pb.Sample {
1042 for j, v := range s.Value {
1043 pb.Sample[i].Value[j] = 10 * v
1044 }
1045 }
1046
1047 p := testProfile1.Copy()
1048
1049 err := p.Normalize(pb)
1050 if err != nil {
1051 t.Fatal(err)
1052 }
1053
1054 for i, s := range p.Sample {
1055 for j, v := range s.Value {
1056 expectedSampleValue := 10 * testProfile1.Sample[i].Value[j]
1057 if v != expectedSampleValue {
1058 t.Errorf("For sample %d, value %d, want %d got %d", i, j, expectedSampleValue, v)
1059 }
1060 }
1061 }
1062}
1063
1064func TestNormalizeIncompatibleProfiles(t *testing.T) {
1065 p := 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…