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

Function formatLabelValues

internal/driver/tagroot.go:115–133  ·  view source on GitHub ↗

formatLabelValues returns all the string and numeric labels in Sample, with the numeric labels formatted according to outputUnit.

(s *profile.Sample, k string, outputUnit string)

Source from the content-addressed store, hash-verified

113// formatLabelValues returns all the string and numeric labels in Sample, with
114// the numeric labels formatted according to outputUnit.
115func formatLabelValues(s *profile.Sample, k string, outputUnit string) []string {
116 var values []string
117 values = append(values, s.Label[k]...)
118 numLabels := s.NumLabel[k]
119 numUnits := s.NumUnit[k]
120 if len(numLabels) != len(numUnits) && len(numUnits) != 0 {
121 return values
122 }
123 for i, numLabel := range numLabels {
124 var value string
125 if len(numUnits) != 0 {
126 value = measurement.ScaledLabel(numLabel, numUnits[i], outputUnit)
127 } else {
128 value = measurement.ScaledLabel(numLabel, "", "")
129 }
130 values = append(values, value)
131 }
132 return values
133}

Callers 1

addLabelNodesFunction · 0.85

Calls 1

ScaledLabelFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…