mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-27 05:46:25 +02:00
Add a metric "http_requests_in_flight"
This commit is contained in:
parent
bbd716c747
commit
606b3fbbf5
2 changed files with 12 additions and 1 deletions
|
|
@ -223,7 +223,12 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
timer := prometheus.NewTimer(metricRequestDuration)
|
||||
defer timer.ObserveDuration()
|
||||
metricRequestsInFlight.Inc()
|
||||
defer func() {
|
||||
timer.ObserveDuration()
|
||||
metricRequestsInFlight.Dec()
|
||||
}()
|
||||
|
||||
h.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue