MCPcopy Create free account
hub / github.com/cortexproject/cortex / update

Method update

pkg/ruler/external_labels.go:37–54  ·  view source on GitHub ↗
(userID string)

Source from the content-addressed store, hash-verified

35}
36
37func (e *userExternalLabels) update(userID string) (labels.Labels, bool) {
38 lset := e.limits.RulerExternalLabels(userID)
39
40 e.mtx.Lock()
41 defer e.mtx.Unlock()
42
43 e.builder.Reset(e.global)
44 lset.Range(func(l labels.Label) {
45 e.builder.Set(l.Name, l.Value)
46 })
47 lset = e.builder.Labels()
48
49 if !labels.Equal(e.users[userID], lset) {
50 e.users[userID] = lset
51 return lset, true
52 }
53 return lset, false
54}
55
56func (e *userExternalLabels) remove(user string) {
57 e.mtx.Lock()

Callers 2

TestUserExternalLabelsFunction · 0.80
syncRulesToManagerMethod · 0.80

Calls 5

RulerExternalLabelsMethod · 0.65
SetMethod · 0.65
EqualMethod · 0.65
ResetMethod · 0.45
LabelsMethod · 0.45

Tested by 1

TestUserExternalLabelsFunction · 0.64