Commit 79f72a39 authored by duanjinfei's avatar duanjinfei

add pprof

parent 282907d0
...@@ -11,6 +11,7 @@ import ( ...@@ -11,6 +11,7 @@ import (
"github.com/fsnotify/fsnotify" "github.com/fsnotify/fsnotify"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"net/http"
_ "net/http/pprof" _ "net/http/pprof"
"os" "os"
"strings" "strings"
...@@ -74,6 +75,13 @@ var RootCmd = &cobra.Command{ ...@@ -74,6 +75,13 @@ var RootCmd = &cobra.Command{
} }
go nm.StartMonitor() go nm.StartMonitor()
} }
go func() {
err := http.ListenAndServe("0.0.0.0:6060", nil)
if err != nil {
log.Error("http listen pprof server failed")
return
}
}()
beego.Run() beego.Run()
}, },
} }
......
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