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:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user