mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 23:39:48 +01:00
lib/storage: do not increment vm_slow_metric_name_loads_total
counter for metric_ids which shouldnt be prefetched, since this may mislead users
This commit is contained in:
parent
dc16cdd1ca
commit
2a8f1e6931
@ -877,11 +877,11 @@ func (s *Storage) prefetchMetricNames(tsids []TSID) error {
|
|||||||
metricIDs = append(metricIDs, metricID)
|
metricIDs = append(metricIDs, metricID)
|
||||||
tsidsMap[metricID] = &tsids[i]
|
tsidsMap[metricID] = &tsids[i]
|
||||||
}
|
}
|
||||||
atomic.AddUint64(&s.slowMetricNameLoads, uint64(len(metricIDs)))
|
|
||||||
if len(metricIDs) < 500 {
|
if len(metricIDs) < 500 {
|
||||||
// It is cheaper to skip pre-fetching and obtain metricNames inline.
|
// It is cheaper to skip pre-fetching and obtain metricNames inline.
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
atomic.AddUint64(&s.slowMetricNameLoads, uint64(len(metricIDs)))
|
||||||
|
|
||||||
// Pre-fetch metricIDs.
|
// Pre-fetch metricIDs.
|
||||||
sort.Sort(metricIDs)
|
sort.Sort(metricIDs)
|
||||||
|
Loading…
Reference in New Issue
Block a user