From c5f94fa5fc1d596c900fe38249dbb9822004a83e Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 20 Jul 2023 11:18:19 -0700 Subject: [PATCH] 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 6a96fd8ed5ba738f545dab8a3896ab4661eacbf7 Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4598 --- app/vmselect/main.go | 2 +- app/vmselect/promql/active_queries.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/vmselect/main.go b/app/vmselect/main.go index 2b3fc74c7..7f10095dd 100644 --- a/app/vmselect/main.go +++ b/app/vmselect/main.go @@ -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() diff --git a/app/vmselect/promql/active_queries.go b/app/vmselect/promql/active_queries.go index 8e0e22eb9..d66058e53 100644 --- a/app/vmselect/promql/active_queries.go +++ b/app/vmselect/promql/active_queries.go @@ -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")