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

Method store

server/controller/prometheus/encoder/label.go:53–65  ·  view source on GitHub ↗
(item *metadbmodel.PrometheusLabel)

Source from the content-addressed store, hash-verified

51}
52
53func (l *label) store(item *metadbmodel.PrometheusLabel) {
54 nameID, ok1 := l.labelName.getID(item.Name)
55 valueID, ok2 := l.labelValue.getID(item.Value)
56 if !ok1 || !ok2 {
57 return
58 }
59 key := cache.IDLabelKey{NameID: nameID, ValueID: valueID}
60 l.labelKeyToID[key] = item.ID
61
62 if l.isRefreshing {
63 l.pendingKeys[key] = item.ID
64 }
65}
66
67func (l *label) getID(key cache.IDLabelKey) (int, bool) {
68 id, ok := l.labelKeyToID[key]

Callers 1

encodeMethod · 0.95

Calls 1

getIDMethod · 0.45

Tested by

no test coverage detected