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

Method decreaseSeriesForMetric

pkg/ingester/user_state.go:54–63  ·  view source on GitHub ↗
(metricName string)

Source from the content-addressed store, hash-verified

52}
53
54func (m *metricCounter) decreaseSeriesForMetric(metricName string) {
55 shard := m.getShard(metricName)
56 shard.mtx.Lock()
57 defer shard.mtx.Unlock()
58
59 shard.m[metricName]--
60 if shard.m[metricName] == 0 {
61 delete(shard.m, metricName)
62 }
63}
64
65func (m *metricCounter) getShard(metricName string) *metricCounterShard {
66 shard := &m.shards[util.HashFP(model.Fingerprint(fnv1a.HashString64(metricName)))%numMetricCounterShards]

Callers 1

PostDeletionMethod · 0.80

Calls 1

getShardMethod · 0.95

Tested by

no test coverage detected