1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 05:10:39 +00:00

Add .Elapsed in context.ResponseWriter for monitor purpose

With this commit we can record per requests's elapsed time,
so we can easy to monitor that by use a filter.
This commit is contained in:
wanghui
2018-11-19 16:38:14 +08:00
parent 7a50ea7e36
commit b021686521
2 changed files with 4 additions and 3 deletions

View File

@ -201,6 +201,7 @@ type Response struct {
http.ResponseWriter
Started bool
Status int
Elapsed time.Duration
}
func (r *Response) reset(rw http.ResponseWriter) {
@ -259,4 +260,4 @@ func (r *Response) Pusher() (pusher http.Pusher) {
return pusher
}
return nil
}
}