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

Function normalizeActions

src/go/plugin/framework/chartemit/apply.go:131–151  ·  view source on GitHub ↗
(actions []EngineAction)

Source from the content-addressed store, hash-verified

129}
130
131func normalizeActions(actions []EngineAction) normalizedActions {
132 out := normalizedActions{
133 createCharts: make(map[string]CreateChartAction),
134 createDimsByID: make(map[string][]CreateDimensionAction),
135 }
136 for _, action := range actions {
137 switch v := action.(type) {
138 case CreateChartAction:
139 out.createCharts[v.ChartID] = v
140 case CreateDimensionAction:
141 out.createDimsByID[v.ChartID] = append(out.createDimsByID[v.ChartID], v)
142 case UpdateChartAction:
143 out.updateCharts = append(out.updateCharts, v)
144 case RemoveDimensionAction:
145 out.removeDimensions = append(out.removeDimensions, v)
146 case RemoveChartAction:
147 out.removeCharts = append(out.removeCharts, v)
148 }
149 }
150 return out
151}
152
153func emitCreatePhase(api *netdataapi.API, env EmitEnv, actions normalizedActions) {
154 createdChartIDs := make([]string, 0, len(actions.createCharts))

Callers 2

ApplyPlanFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…