MCPcopy Create free account
hub / github.com/deepflowio/deepflow / Add

Method Add

server/controller/prometheus/cache/label_name.go:96–103  ·  view source on GitHub ↗
(batch []*controller.PrometheusLabelName)

Source from the content-addressed store, hash-verified

94}
95
96func (ln *labelName) Add(batch []*controller.PrometheusLabelName) {
97 ln.mu.Lock()
98 defer ln.mu.Unlock()
99 for _, item := range batch {
100 ln.pendingNameToID[item.GetName()] = int(item.GetId())
101 ln.pendingIDToName[int(item.GetId())] = item.GetName()
102 }
103}
104
105func (ln *labelName) refresh(args ...interface{}) error {
106 items, err := ln.load()

Callers

nothing calls this directly

Calls 3

GetNameMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected