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

Method SetLabel

profile/profile.go:718–726  ·  view source on GitHub ↗

SetLabel sets the specified key to the specified value for all samples in the profile.

(key string, value []string)

Source from the content-addressed store, hash-verified

716// SetLabel sets the specified key to the specified value for all samples in the
717// profile.
718func (p *Profile) SetLabel(key string, value []string) {
719 for _, sample := range p.Sample {
720 if sample.Label == nil {
721 sample.Label = map[string][]string{key: value}
722 } else {
723 sample.Label[key] = value
724 }
725 }
726}
727
728// RemoveLabel removes all labels associated with the specified key for all
729// samples in the profile.

Callers 2

TestSetLabelFunction · 0.80
fetchProfilesFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestSetLabelFunction · 0.64