(metricName string)
| 52 | } |
| 53 | |
| 54 | func (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 | |
| 65 | func (m *metricCounter) getShard(metricName string) *metricCounterShard { |
| 66 | shard := &m.shards[util.HashFP(model.Fingerprint(fnv1a.HashString64(metricName)))%numMetricCounterShards] |