Add the dashboard monitor.

This commit is contained in:
zicla
2018-12-02 18:38:39 +08:00
parent 2d1a95594f
commit 927427f353
18 changed files with 169 additions and 34 deletions

View File

@ -87,7 +87,9 @@ func (this *Router) GlobalPanicHandler(writer http.ResponseWriter, request *http
}
//错误情况记录。
go this.footprintService.Trace(writer, request, time.Now().Sub(startTime), false)
go SafeMethod(func() {
this.footprintService.Trace(writer, request, time.Now().Sub(startTime), false)
})
}
}
@ -123,14 +125,15 @@ func (this *Router) ServeHTTP(writer http.ResponseWriter, request *http.Request)
}
if !canHandle {
panic(fmt.Sprintf("没有找到能够处理%s的方法\n", path))
panic(CustomWebResult(CODE_WRAPPER_NOT_FOUND, fmt.Sprintf("没有找到能够处理%s的方法", path)))
}
}
//正常的访问记录会落到这里。
go this.footprintService.Trace(writer, request, time.Now().Sub(startTime), true)
go SafeMethod(func() {
this.footprintService.Trace(writer, request, time.Now().Sub(startTime), true)
})
} else {
//当作静态资源处理。默认从当前文件下面的static文件夹中取东西。
dir := GetHtmlPath()