mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
Moved pprof server on http server
This commit is contained in:
committed by
Dan Christian Bogos
parent
ac24c23cbf
commit
3ee8539908
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user