Moved pprof server on http server

This commit is contained in:
Trial97
2019-02-21 14:27:42 +02:00
committed by Dan Christian Bogos
parent ac24c23cbf
commit 3ee8539908
8 changed files with 3 additions and 29 deletions

View File

@@ -22,8 +22,6 @@ import (
"flag"
"fmt"
"log"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"path"
@@ -1140,13 +1138,6 @@ func schedCDRsConns(internalCDRSChan chan rpcclient.RpcClientConnection, exitCha
engine.SetSchedCdrsConns(cdrsConn)
}
func startProfServer(adress string) {
go func() {
if err := http.ListenAndServe(adress, nil); err != nil {
utils.Logger.Err(fmt.Sprintf("<HTTPPprof> could not start HTTP server for profiling: %v", err.Error()))
}
}()
}
func memProfFile(memProfPath string) bool {
f, err := os.Create(memProfPath)
@@ -1258,9 +1249,7 @@ func main() {
lgLevel = *logLevel
}
utils.Logger.SetLogLevel(lgLevel)
if cfg.GeneralCfg().EnableHTTPPprof {
startProfServer(cfg.ListenCfg().HTTPPprof)
}
var loadDb engine.LoadStorage
var cdrDb engine.CdrStorage
var dm *engine.DataManager