MCPcopy
hub / github.com/netdata/netdata / New

Function New

src/go/plugin/framework/chartengine/engine.go:27–48  ·  view source on GitHub ↗

New creates an engine scaffold with optional configuration.

(opts ...Option)

Source from the content-addressed store, hash-verified

25
26// New creates an engine scaffold with optional configuration.
27func New(opts ...Option) (*Engine, error) {
28 cfg, err := applyOptions(opts...)
29 if err != nil {
30 return nil, err
31 }
32
33 runtimeStore := cfg.runtimeStore
34 if !cfg.runtimeStoreSet {
35 runtimeStore = metrix.NewRuntimeStore()
36 }
37
38 return &Engine{
39 state: engineState{
40 cfg: cfg,
41 routeCache: newRouteCache(),
42 materialized: newMaterializedState(),
43 runtimeStore: runtimeStore,
44 runtimeStats: newRuntimeMetrics(runtimeStore),
45 log: cfg.log,
46 },
47 }, nil
48}
49
50// Load compiles and publishes a new immutable program revision.
51func (e *Engine) Load(spec *charttpl.Spec, revision uint64) error {

Calls 4

applyOptionsFunction · 0.85
newRouteCacheFunction · 0.85
newMaterializedStateFunction · 0.85
newRuntimeMetricsFunction · 0.85