MCPcopy Index your code
hub / github.com/netdata/netdata / metricKindsFromNames

Function metricKindsFromNames

src/go/plugin/framework/chartengine/compiler.go:368–385  ·  view source on GitHub ↗
(names []string)

Source from the content-addressed store, hash-verified

366}
367
368func metricKindsFromNames(names []string) []string {
369 seen := make(map[string]struct{})
370 for _, name := range names {
371 switch {
372 case strings.HasSuffix(name, "_total"):
373 seen["counter_like"] = struct{}{}
374 case strings.HasSuffix(name, "_count"):
375 seen["counter_like"] = struct{}{}
376 case strings.HasSuffix(name, "_sum"):
377 seen["counter_like"] = struct{}{}
378 case strings.HasSuffix(name, "_bucket"):
379 seen["counter_like"] = struct{}{}
380 default:
381 seen["gauge_like"] = struct{}{}
382 }
383 }
384 return mapKeysSorted(seen)
385}
386
387func supportsRuntimeInferredDimension(meta metrixselector.Meta) bool {
388 for _, key := range meta.ConstrainedLabelKeys {

Callers 1

compileDimensionFunction · 0.85

Calls 1

mapKeysSortedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…