Commit 9872041f authored by JessonChan's avatar JessonChan

timeDur is used only when need

parent 83fe43f3
...@@ -802,9 +802,9 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -802,9 +802,9 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
p.execFilter(context, FinishRouter, urlPath) p.execFilter(context, FinishRouter, urlPath)
Admin: Admin:
timeDur := time.Since(startTime)
//admin module record QPS //admin module record QPS
if BConfig.Listen.EnableAdmin { if BConfig.Listen.EnableAdmin {
timeDur := time.Since(startTime)
if FilterMonitorFunc(r.Method, r.URL.Path, timeDur) { if FilterMonitorFunc(r.Method, r.URL.Path, timeDur) {
if runRouter != nil { if runRouter != nil {
go toolbox.StatisticsMap.AddStatistics(r.Method, r.URL.Path, runRouter.Name(), timeDur) go toolbox.StatisticsMap.AddStatistics(r.Method, r.URL.Path, runRouter.Name(), timeDur)
...@@ -815,6 +815,7 @@ Admin: ...@@ -815,6 +815,7 @@ Admin:
} }
if BConfig.RunMode == DEV || BConfig.Log.AccessLogs { if BConfig.RunMode == DEV || BConfig.Log.AccessLogs {
timeDur := time.Since(startTime)
var devInfo string var devInfo string
if findRouter { if findRouter {
if routerInfo != nil { if routerInfo != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment