MCPcopy Index your code
hub / github.com/prometheus/prometheus / formatQuery

Method formatQuery

web/api/v1/api.go:588–595  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

586}
587
588func (api *API) formatQuery(r *http.Request) (result apiFuncResult) {
589 expr, err := api.parser.ParseExpr(r.FormValue("query"))
590 if err != nil {
591 return invalidParamError(err, "query")
592 }
593
594 return apiFuncResult{expr.Pretty(0), nil, nil, nil}
595}
596
597func (api *API) parseQuery(r *http.Request) apiFuncResult {
598 expr, err := api.parser.ParseExpr(r.FormValue("query"))

Callers

nothing calls this directly

Calls 3

invalidParamErrorFunction · 0.85
ParseExprMethod · 0.65
PrettyMethod · 0.65

Tested by

no test coverage detected