feat: add pprof server for memory profiling

This commit is contained in:
tinkle-community
2025-12-31 13:19:58 +08:00
parent a555cbe463
commit 445c3aad69

10
main.go
View File

@@ -1,6 +1,8 @@
package main
import (
"net/http"
_ "net/http/pprof"
"nofx/api"
"nofx/auth"
"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
server := api.NewServer(traderManager, st, cryptoService, backtestManager, cfg.APIServerPort)
go func() {