mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Enable Go linter gocritic (#26224)
* Chore: Enable gocritic linter Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -43,11 +43,12 @@ func RequestMetrics(handler string) macaron.Handler {
|
||||
duration := time.Since(now).Nanoseconds() / int64(time.Millisecond)
|
||||
metrics.MHttpRequestSummary.WithLabelValues(handler, code, method).Observe(float64(duration))
|
||||
|
||||
if strings.HasPrefix(req.RequestURI, "/api/datasources/proxy") {
|
||||
switch {
|
||||
case strings.HasPrefix(req.RequestURI, "/api/datasources/proxy"):
|
||||
countProxyRequests(status)
|
||||
} else if strings.HasPrefix(req.RequestURI, "/api/") {
|
||||
case strings.HasPrefix(req.RequestURI, "/api/"):
|
||||
countApiRequests(status)
|
||||
} else {
|
||||
default:
|
||||
countPageRequests(status)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user