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

Function sampleFuncs

profile/filter_test.go:545–557  ·  view source on GitHub ↗

sampleFuncs returns a slice of strings where each string represents one profile sample in the format " : ". This allows the expected values for test cases to be specified in human-readable strings.

(p *Profile)

Source from the content-addressed store, hash-verified

543// the expected values for test cases to be specified in human-readable
544// strings.
545func sampleFuncs(p *Profile) []string {
546 var ret []string
547 for _, s := range p.Sample {
548 var funcs []string
549 for _, loc := range s.Location {
550 for _, line := range loc.Line {
551 funcs = append(funcs, line.Function.Name)
552 }
553 }
554 ret = append(ret, fmt.Sprintf("%s: %d", strings.Join(funcs, " "), s.Value[0]))
555 }
556 return ret
557}
558
559func TestTagFilter(t *testing.T) {
560 // Perform several forms of tag filtering on the test profile.

Callers 2

TestFilterSamplesByNameFunction · 0.85
TestShowFromFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…