mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-18 18:04:32 +08:00
feat: add pprof server for memory profiling
This commit is contained in:
10
main.go
10
main.go
@@ -1,6 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"nofx/api"
|
"nofx/api"
|
||||||
"nofx/auth"
|
"nofx/auth"
|
||||||
"nofx/backtest"
|
"nofx/backtest"
|
||||||
@@ -139,6 +141,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start pprof server for profiling (port 6060)
|
||||||
|
go func() {
|
||||||
|
logger.Info("📊 Starting pprof server on :6060")
|
||||||
|
if err := http.ListenAndServe(":6060", nil); err != nil {
|
||||||
|
logger.Warnf("⚠️ pprof server error: %v", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// Start API server
|
// Start API server
|
||||||
server := api.NewServer(traderManager, st, cryptoService, backtestManager, cfg.APIServerPort)
|
server := api.NewServer(traderManager, st, cryptoService, backtestManager, cfg.APIServerPort)
|
||||||
go func() {
|
go func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user