MCPcopy Create free account
hub / github.com/deepflowio/deepflow / generateProtoLabels

Function generateProtoLabels

server/controller/prometheus/cache/cache_test.go:52–62  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

50}
51
52func generateProtoLabels(n int) []*controller.PrometheusLabel {
53 labels := make([]*controller.PrometheusLabel, n)
54 for i := 0; i < n; i++ {
55 labels[i] = &controller.PrometheusLabel{
56 Name: proto.String(fmt.Sprintf("label_name_%d", i)),
57 Value: proto.String(fmt.Sprintf("label_value_%d", i)),
58 Id: proto.Uint32(uint32(i + 1)),
59 }
60 }
61 return labels
62}
63
64func generateProtoMetricNames(n int) []*controller.PrometheusMetricName {
65 names := make([]*controller.PrometheusMetricName, n)

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected