From c30872f6cd7c0610cad7c13113dd42117a515814 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 18 Dec 2023 16:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0cmd=20=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lego/sys/pprof/sys_test.go | 12 ++++++------ services/cmd/main.go | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lego/sys/pprof/sys_test.go b/lego/sys/pprof/sys_test.go index 2bde94230..c280b1a3c 100644 --- a/lego/sys/pprof/sys_test.go +++ b/lego/sys/pprof/sys_test.go @@ -2,18 +2,18 @@ package pprof_test /* 查看堆栈调用信息 -go tool pprof http://localhost:6060/debug/pprof/heap +go tool pprof http://122.51.39.132:9090/debug/pprof/heap 查看 30 秒内的 CPU 信息 -go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30 +go tool pprof http://122.51.39.132:9090/debug/pprof/profile?seconds=30 查看 goroutine 阻塞 -go tool pprof http://localhost:6060/debug/pprof/block +go tool pprof http://122.51.39.132:9090/debug/pprof/block 收集 5 秒内的执行路径 -go tool pprof http://localhost:6060/debug/pprof/trace?seconds=5 +go tool pprof http://122.51.39.132:9090/debug/pprof/trace?seconds=5 争用互斥持有者的堆栈跟踪 -go tool pprof http://localhost:6060/debug/pprof/mutex +go tool pprof http://122.51.39.132:9090/debug/pprof/mutex */ /* UI web 界面 -curl -sK -v http://localhost:6060/debug/pprof/heap > heap.out +curl -sK -v http://122.51.39.132:9090/debug/pprof/heap > heap.out go tool pprof -http=:8080 heap.out */ diff --git a/services/cmd/main.go b/services/cmd/main.go index 2a3e7be10..bfaf31692 100644 --- a/services/cmd/main.go +++ b/services/cmd/main.go @@ -156,6 +156,9 @@ func start() { log.Error("写入配置文件失败!", log.Field{Key: "err", Value: err.Error()}) return } + if config.IsCross && v.Type == comm.Service_Gateway { + continue + } switch v.Type { case comm.Service_Gateway: //网关服务 gateways = append(gateways, v)