MCPcopy
hub / github.com/netdata/netdata / snapshotFunction

Method snapshotFunction

src/go/plugin/framework/functions/manager.go:699–716  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

697}
698
699func (m *Manager) snapshotFunction(name string) (functionSnapshot, bool) {
700 m.mux.Lock()
701 fs, ok := m.functionRegistry[name]
702 snap := functionSnapshot{}
703 if ok && fs != nil {
704 snap.direct = fs.direct
705 if len(fs.prefixes) > 0 {
706 snap.prefixes = make(map[string]func(Function), len(fs.prefixes))
707 maps.Copy(snap.prefixes, fs.prefixes)
708 }
709 }
710 m.mux.Unlock()
711
712 if !ok || fs == nil {
713 return functionSnapshot{}, false
714 }
715 return snap, true
716}
717
718func matchPrefix(prefixes map[string]func(Function), id string) (string, func(Function), bool) {
719 if len(prefixes) == 0 || id == "" {

Callers 2

lookupFunctionRouteMethod · 0.95
lookupFunctionMethod · 0.95

Calls 3

LockMethod · 0.80
UnlockMethod · 0.80
CopyMethod · 0.45

Tested by

no test coverage detected