mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect/promql/active_queries.go: simplify code a bit by inlining getNextActiveQueryID function
This commit is contained in:
parent
b66c7c13ac
commit
2d9b3ad5b3
1 changed files with 1 additions and 5 deletions
|
@ -51,7 +51,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()
|
||||
|
||||
|
@ -77,8 +77,4 @@ func (aq *activeQueries) GetAll() []activeQueryEntry {
|
|||
return aqes
|
||||
}
|
||||
|
||||
func getNextActiveQueryID() uint64 {
|
||||
return atomic.AddUint64(&nextActiveQueryID, 1)
|
||||
}
|
||||
|
||||
var nextActiveQueryID = uint64(time.Now().UnixNano())
|
||||
|
|
Loading…
Reference in a new issue