mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-04 11:14:42 +08:00
reverseproxy: Add _ms
placeholders for proxy durations (#4666)
* reverseproxy: Add `_ms` placeholders for proxy durations * Add http.request.duration_ms Also add comments, and change duration_sec to duration_ms * Add response.duration_ms for consistency * Add missing godoc comment Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
This commit is contained in:
@ -190,6 +190,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
repl.Set("http.response.status", wrec.Status())
|
||||
repl.Set("http.response.size", wrec.Size())
|
||||
repl.Set("http.response.duration", duration)
|
||||
repl.Set("http.response.duration_ms", duration.Seconds()*1e3) // multiply seconds to preserve decimal (see #4666)
|
||||
|
||||
logger := accLog
|
||||
if s.Logs != nil {
|
||||
|
Reference in New Issue
Block a user