From bee6291a125ecf65e95e38a1b2ffac407041d579 Mon Sep 17 00:00:00 2001 From: 1 <1@72wo.cn> Date: Wed, 15 Oct 2025 15:54:35 +0000 Subject: [PATCH] =?UTF-8?q?```feat(logic):=20=E6=B7=BB=E5=8A=A0pprof?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E5=88=86=E6=9E=90=E6=94=AF=E6=8C=81=E5=B9=B6?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D=E7=BD=AE?= =?UTF-8?q?```?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + logic/main.go | 11 +++++++++++ manifest/config/config.yaml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5c77766ee..241e06a4b 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ logic/logic_linux_amd64 login/login_linux_amd64 logic/logic .gitignore +public/logic diff --git a/logic/main.go b/logic/main.go index ff969610c..1a11fb7af 100644 --- a/logic/main.go +++ b/logic/main.go @@ -13,10 +13,18 @@ import ( "blazing/cool" //"blazing/o/service" + "net/http" + _ "net/http/pprof" "github.com/gogf/gf/v2/os/gctx" ) +func PprofWeb() { + err := http.ListenAndServe(":9909", nil) + if err != nil { + panic(err) + } +} func signalHandlerForMain(sig os.Signal) { fight.Fightpool.Release() fmt.Println("MainProcess is shutting down due to signal:", sig.String()) @@ -29,6 +37,9 @@ func main() { } go Start(cool.Config.PortBL) //注入service + if cool.Config.PortBL == 1 { //只分析1服务器的 + go PprofWeb() + } fmt.Println("Process start, pid:", os.Getpid()) diff --git a/manifest/config/config.yaml b/manifest/config/config.yaml index 4bce7efcf..7a2c1e1f5 100644 --- a/manifest/config/config.yaml +++ b/manifest/config/config.yaml @@ -1,6 +1,6 @@ server: name: "blazing server" - address: ":59480" #前台服务器地址 + address: ":8080" #前台服务器地址 port: 53388 #后台服务器端口 rpc: 56409 #rpc服务端口 game: [55407,50876,52482]