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

Method HasLabel

profile/profile.go:737–739  ·  view source on GitHub ↗

HasLabel returns true if a sample has a label with indicated key and value.

(key, value string)

Source from the content-addressed store, hash-verified

735
736// HasLabel returns true if a sample has a label with indicated key and value.
737func (s *Sample) HasLabel(key, value string) bool {
738 return slices.Contains(s.Label[key], value)
739}
740
741// SetNumLabel sets the specified key to the specified value for all samples in the
742// profile. "unit" is a slice that describes the units that each corresponding member

Callers 2

DiffBaseSampleMethod · 0.95
TestHasLabelFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestHasLabelFunction · 0.76