mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-16 17:12:25 +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
|
||||
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user