(actions []EngineAction)
| 129 | } |
| 130 | |
| 131 | func 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 | |
| 153 | func emitCreatePhase(api *netdataapi.API, env EmitEnv, actions normalizedActions) { |
| 154 | createdChartIDs := make([]string, 0, len(actions.createCharts)) |
no outgoing calls
searching dependent graphs…