mirror of
https://github.com/astaxie/beego.git
synced 2025-07-02 12:50:18 +00:00
Improve monitoring management module
This commit is contained in:
12
router.go
12
router.go
@ -846,12 +846,14 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
Admin:
|
||||
//admin module record QPS
|
||||
if EnableAdmin {
|
||||
if runrouter != nil {
|
||||
go admin.StatisticsMap.AddStatistics(r.Method, requestPath, runrouter.controllerType.Name(), time.Since(starttime))
|
||||
} else {
|
||||
go admin.StatisticsMap.AddStatistics(r.Method, requestPath, "", time.Since(starttime))
|
||||
timeend := time.Since(starttime)
|
||||
if FilterMonitorFunc(r.Method, requestPath, timeend) {
|
||||
if runrouter != nil {
|
||||
go admin.StatisticsMap.AddStatistics(r.Method, requestPath, runrouter.controllerType.Name(), timeend)
|
||||
} else {
|
||||
go admin.StatisticsMap.AddStatistics(r.Method, requestPath, "", timeend)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user