MCPcopy
hub / github.com/netdata/netdata / Copy

Method Copy

src/go/plugin/framework/collectorapi/charts.go:348–361  ·  view source on GitHub ↗

Copy returns a deep copy of the chart.

()

Source from the content-addressed store, hash-verified

346
347// Copy returns a deep copy of the chart.
348func (c Chart) Copy() *Chart {
349 chart := c
350 chart.Dims = Dims{}
351 chart.Vars = Vars{}
352
353 for idx := range c.Dims {
354 chart.Dims = append(chart.Dims, c.Dims[idx].copy())
355 }
356 for idx := range c.Vars {
357 chart.Vars = append(chart.Vars, c.Vars[idx].copy())
358 }
359
360 return &chart
361}
362
363func (c Chart) indexDim(dimID string) int {
364 for idx := range c.Dims {

Callers 15

buildRunEnvFunction · 0.45
vnodeInfoFromVirtualNodeFunction · 0.45
cloneIntMetricsFunction · 0.45
cloneJobAnalysisFunction · 0.45
cloneChartAnalysisFunction · 0.45
snapshotFunctionMethod · 0.45
TestChart_CopyFunction · 0.45
CopyMethod · 0.45
CleanupMethod · 0.45
runOnceMethod · 0.45
processMetricsMethod · 0.45
NewJobV2Function · 0.45

Calls 1

copyMethod · 0.45

Tested by 3

TestChart_CopyFunction · 0.36
TestJobV2ScenariosFunction · 0.36