add: pprof debug
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
_ "net/http/pprof"
|
||||
|
||||
"be.ems/features/dbrest"
|
||||
"be.ems/features/event"
|
||||
"be.ems/features/fm"
|
||||
@@ -185,12 +187,20 @@ func HttpListenWebServer(addr string) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
// src 配置中心初始加载
|
||||
src.ConfigurationInit()
|
||||
app := src.AppEngine()
|
||||
|
||||
conf := config.GetYamlConfig()
|
||||
|
||||
if conf.Pprof.Enabled {
|
||||
// 启用pprof HTTP服务
|
||||
go func() {
|
||||
fmt.Println(http.ListenAndServe(conf.Pprof.Addr, nil))
|
||||
}()
|
||||
}
|
||||
|
||||
log.InitLogger(conf.Logger.File, conf.Logger.Duration, conf.Logger.Count, "omc:restagent", config.GetLogLevel())
|
||||
fmt.Printf("OMC restagent version: %s\n", global.Version)
|
||||
log.Infof("========================= OMC restagent startup =========================")
|
||||
|
||||
Reference in New Issue
Block a user