diff --git a/app/vmselect/promql/active_queries.go b/app/vmselect/promql/active_queries.go index f8abf987ea..6e6a0db417 100644 --- a/app/vmselect/promql/active_queries.go +++ b/app/vmselect/promql/active_queries.go @@ -56,7 +56,7 @@ func (aq *activeQueries) Add(ec *EvalConfig, q string) uint64 { aqe.start = ec.Start aqe.end = ec.End aqe.step = ec.Step - aqe.qid = getNextActiveQueryID() + aqe.qid = atomic.AddUint64(&nextActiveQueryID, 1) aqe.q = q aqe.startTime = time.Now() @@ -82,8 +82,4 @@ func (aq *activeQueries) GetAll() []activeQueryEntry { return aqes } -func getNextActiveQueryID() uint64 { - return atomic.AddUint64(&nextActiveQueryID, 1) -} - var nextActiveQueryID = uint64(time.Now().UnixNano())