| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package chartengine |
| 4 | |
| 5 | import ( |
| 6 | "github.com/netdata/netdata/go/plugins/logger" |
| 7 | "github.com/netdata/netdata/go/plugins/pkg/metrix" |
| 8 | "github.com/netdata/netdata/go/plugins/plugin/framework/chartengine/internal/program" |
| 9 | ) |
| 10 | |
| 11 | type engineState struct { |
| 12 | cfg engineConfig |
| 13 | program *program.Program |
| 14 | matchIndex matchIndex |
| 15 | routeCache *routeCache |
| 16 | materialized materializedState |
| 17 | engineEpoch uint64 |
| 18 | commitSeq uint64 |
| 19 | nextAttempt uint64 |
| 20 | outstanding uint64 |
| 21 | hints plannerSizingHints |
| 22 | buildSeq buildSeqState |
| 23 | // plannerBuildSeq is runtime-mode build-cycle sequence used only by |
| 24 | // per-build dedupe/scratch bookkeeping. |
| 25 | plannerBuildSeq uint64 |
| 26 | stats engineStats |
| 27 | runtimeStore metrix.RuntimeStore |
| 28 | runtimeStats *runtimeMetrics |
| 29 | log *logger.Logger |
| 30 | } |
| 31 | |
| 32 | type plannerSizingHints struct { |
| 33 | chartsByID int |
| 34 | seenInfer int |
| 35 | } |
| 36 | |
| 37 | type buildSeqState struct { |
| 38 | initialized bool |
| 39 | violating bool |
| 40 | lastSuccess uint64 |
| 41 | } |