SetNumLabel sets the specified key to the specified value for all samples in the profile. "unit" is a slice that describes the units that each corresponding member of "values" is measured in (e.g. bytes or seconds). If there is no relevant unit for a given value, that member of "unit" should be the
(key string, value []int64, unit []string)
| 744 | // unit for a given value, that member of "unit" should be the empty string. |
| 745 | // "unit" must either have the same length as "value", or be nil. |
| 746 | func (p *Profile) SetNumLabel(key string, value []int64, unit []string) { |
| 747 | for _, sample := range p.Sample { |
| 748 | if sample.NumLabel == nil { |
| 749 | sample.NumLabel = map[string][]int64{key: value} |
| 750 | } else { |
| 751 | sample.NumLabel[key] = value |
| 752 | } |
| 753 | if sample.NumUnit == nil { |
| 754 | sample.NumUnit = map[string][]string{key: unit} |
| 755 | } else { |
| 756 | sample.NumUnit[key] = unit |
| 757 | } |
| 758 | } |
| 759 | } |
| 760 | |
| 761 | // RemoveNumLabel removes all numerical labels associated with the specified key for all |
| 762 | // samples in the profile. |
no outgoing calls