MCPcopy
hub / github.com/netdata/netdata / getChartType

Function getChartType

src/go/plugin/framework/jobruntime/job_v1.go:749–767  ·  view source on GitHub ↗
(chart *collectorapi.Chart, j *Job)

Source from the content-addressed store, hash-verified

747}
748
749func getChartType(chart *collectorapi.Chart, j *Job) string {
750 if chart.CachedType() != "" {
751 return chart.CachedType()
752 }
753 if !chart.IDSep {
754 chart.SetCachedType(j.FullName())
755 } else if i := strings.IndexByte(chart.ID, '.'); i != -1 {
756 chart.SetCachedType(j.FullName() + "_" + chart.ID[:i])
757 } else {
758 chart.SetCachedType(j.FullName())
759 }
760 if chart.OverModule != "" {
761 cachedType := chart.CachedType()
762 if v, ok := strings.CutPrefix(cachedType, j.ModuleName()); ok {
763 chart.SetCachedType(chart.OverModule + v)
764 }
765 }
766 return chart.CachedType()
767}
768
769func getChartID(chart *collectorapi.Chart) string {
770 if chart.CachedID() != "" {

Callers 3

processMetricsMethod · 0.85
createChartMethod · 0.85
updateChartMethod · 0.85

Calls 4

CachedTypeMethod · 0.80
SetCachedTypeMethod · 0.80
FullNameMethod · 0.65
ModuleNameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…