app/vmselect: rename promql.WriteActiveQueries() to promql.ActiveQueriesHandler()

This makes it more consistent with the rest of handlers inside app/vmselect/main.go

This is a follow-up for 6a96fd8ed5

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4598
This commit is contained in:
Aliaksandr Valialkin 2023-07-20 11:18:19 -07:00
parent 5b5d8ae51d
commit c5f94fa5fc
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 4 additions and 4 deletions

View file

@ -329,7 +329,7 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool {
case "/api/v1/status/active_queries":
statusActiveQueriesRequests.Inc()
httpserver.EnableCORS(w, r)
promql.WriteActiveQueries(w, r)
promql.ActiveQueriesHandler(w, r)
return true
case "/api/v1/status/top_queries":
topQueriesRequests.Inc()

View file

@ -9,10 +9,10 @@ import (
"time"
)
// WriteActiveQueries writes active queries to w.
// ActiveQueriesHandler returns response to /api/v1/status/active_queries
//
// The written active queries are sorted in descending order of their exeuction duration.
func WriteActiveQueries(w http.ResponseWriter, r *http.Request) {
// It writes a JSON with active queries to w.
func ActiveQueriesHandler(w http.ResponseWriter, r *http.Request) {
aqes := activeQueriesV.GetAll()
w.Header().Set("Content-Type", "application/json")