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

Method string

profile/profile.go:662–681  ·  view source on GitHub ↗

string dumps a text representation of a sample. Intended mainly for debugging purposes.

()

Source from the content-addressed store, hash-verified

660// string dumps a text representation of a sample. Intended mainly
661// for debugging purposes.
662func (s *Sample) string() string {
663 ss := []string{}
664 var sv string
665 for _, v := range s.Value {
666 sv = fmt.Sprintf("%s %10d", sv, v)
667 }
668 sv = sv + ": "
669 for _, l := range s.Location {
670 sv = sv + fmt.Sprintf("%d ", l.ID)
671 }
672 ss = append(ss, sv)
673 const labelHeader = " "
674 if len(s.Label) > 0 {
675 ss = append(ss, labelHeader+labelsToString(s.Label))
676 }
677 if len(s.NumLabel) > 0 {
678 ss = append(ss, labelHeader+numLabelsToString(s.NumLabel, s.NumUnit))
679 }
680 return strings.Join(ss, "\n")
681}
682
683// labelsToString returns a string representation of a
684// map representing labels.

Callers 1

StringMethod · 0.45

Calls 2

labelsToStringFunction · 0.85
numLabelsToStringFunction · 0.85

Tested by

no test coverage detected