mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 23:28:28 +02:00
modernize
This commit is contained in:
parent
c02ac93968
commit
96246b93aa
@ -173,10 +173,8 @@ func RouteMetrics() func(h http.Handler) http.Handler {
|
|||||||
code := strconv.Itoa(m.WrittenStatus())
|
code := strconv.Itoa(m.WrittenStatus())
|
||||||
reqDurationHistogram.WithLabelValues(req.Method, code, route).Observe(time.Since(start).Seconds())
|
reqDurationHistogram.WithLabelValues(req.Method, code, route).Observe(time.Since(start).Seconds())
|
||||||
respSizeHistogram.WithLabelValues(req.Method, code, route).Observe(float64(m.WrittenSize()))
|
respSizeHistogram.WithLabelValues(req.Method, code, route).Observe(float64(m.WrittenSize()))
|
||||||
size := req.ContentLength
|
|
||||||
if size < 0 {
|
size := max(req.ContentLength, 0)
|
||||||
size = 0
|
|
||||||
}
|
|
||||||
reqSizeHistogram.WithLabelValues(req.Method, code, route).Observe(float64(size))
|
reqSizeHistogram.WithLabelValues(req.Method, code, route).Observe(float64(size))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user