2 Star 12 Fork 13

王布衣/engine

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
profile.go 550 Bytes
Copy Edit Raw Blame History
王布衣 authored 2023-10-21 08:17 +08:00 . 给pprof增加开关
package cache
import (
"fmt"
"gitee.com/quant1x/gox/logger"
"net/http"
_ "net/http/pprof"
)
type PprofParameter struct {
Enable bool `yaml:"enable" default:"true"` // 是否开启go tool pprof
Port int `yaml:"port" default:"6060"` // pprof web端口
}
// 启动性能分析工具
func startPprof() {
if !EngineConfig.Runtime.Pprof.Enable {
return
}
go func() {
addr := fmt.Sprintf("localhost:%d", EngineConfig.Runtime.Pprof.Port)
err := http.ListenAndServe(addr, nil)
logger.Info("启动pprof性能分析工具", err)
}()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.7.2

Search