MCPcopy Create free account
hub / github.com/flant/shell-operator / String

Method String

test/utils/prometheus.go:23–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23func (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
36func (pmv PromMetricValue) IsEmpty() bool {
37 return pmv.Name == "" && len(pmv.Labels) == 0 && pmv.Value == 0.0

Callers 2

randomSuffixFunction · 0.45
Test_RegisterCRDFunction · 0.45

Calls

no outgoing calls

Tested by 2

randomSuffixFunction · 0.36
Test_RegisterCRDFunction · 0.36