(limiter *Limiter, ignoredMetricsForSeriesCount map[string]struct{})
| 37 | } |
| 38 | |
| 39 | func newMetricCounter(limiter *Limiter, ignoredMetricsForSeriesCount map[string]struct{}) *metricCounter { |
| 40 | shards := make([]metricCounterShard, 0, numMetricCounterShards) |
| 41 | for range numMetricCounterShards { |
| 42 | shards = append(shards, metricCounterShard{ |
| 43 | m: map[string]int{}, |
| 44 | }) |
| 45 | } |
| 46 | return &metricCounter{ |
| 47 | limiter: limiter, |
| 48 | shards: shards, |
| 49 | |
| 50 | ignoredMetrics: ignoredMetricsForSeriesCount, |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func (m *metricCounter) decreaseSeriesForMetric(metricName string) { |
| 55 | shard := m.getShard(metricName) |
no outgoing calls