()
| 21 | } |
| 22 | |
| 23 | func (pmv PromMetricValue) String() string { |
| 24 | labels := make([]string, 0, len(pmv.Labels)) |
| 25 | for k, v := range pmv.Labels { |
| 26 | labels = append(labels, fmt.Sprintf("%s=%s", k, v)) |
| 27 | } |
| 28 | l := "" |
| 29 | if len(labels) > 0 { |
| 30 | l = fmt.Sprintf("{%s}", strings.Join(labels, ",")) |
| 31 | } |
| 32 | |
| 33 | return fmt.Sprintf("%s%s %v", pmv.Name, l, pmv.Value) |
| 34 | } |
| 35 | |
| 36 | func (pmv PromMetricValue) IsEmpty() bool { |
| 37 | return pmv.Name == "" && len(pmv.Labels) == 0 && pmv.Value == 0.0 |
no outgoing calls