mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
more specific logging
This commit is contained in:
2
main.go
2
main.go
@@ -108,7 +108,7 @@ func (m metrics) recordDuration(start time.Time, name string) {
|
||||
// instrument adds metric instrumentation to the handler passed in as argument
|
||||
func (m metrics) instrument(path string, h http.HandlerFunc) (string, http.HandlerFunc) {
|
||||
return path, func(w http.ResponseWriter, r *http.Request) {
|
||||
defer m.recordDuration(time.Now(), path)
|
||||
defer m.recordDuration(time.Now(), r.URL.Path)
|
||||
h.ServeHTTP(w, r)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user