🔧 Enable pprof by default for now
This commit is contained in:
parent
16c0564c04
commit
ddc73036a8
|
@ -30,7 +30,6 @@ type (
|
||||||
Protocol string `env:"PROTOCOL" envDefault:"http"`
|
Protocol string `env:"PROTOCOL" envDefault:"http"`
|
||||||
RootURL string `env:"ROOT_URL" envDefault:"{{protocol}}://{{domain}}:{{port}}/"`
|
RootURL string `env:"ROOT_URL" envDefault:"{{protocol}}://{{domain}}:{{port}}/"`
|
||||||
StaticURLPrefix string `env:"STATIC_URL_PREFIX"`
|
StaticURLPrefix string `env:"STATIC_URL_PREFIX"`
|
||||||
EnablePprof bool `env:"ENABLE_PPROF"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigDatabase struct {
|
ConfigDatabase struct {
|
||||||
|
@ -88,7 +87,6 @@ func TestConfig(tb testing.TB) *Config {
|
||||||
Server: ConfigServer{
|
Server: ConfigServer{
|
||||||
CertificateFile: filepath.Join("https", "cert.pem"),
|
CertificateFile: filepath.Join("https", "cert.pem"),
|
||||||
Domain: "localhost",
|
Domain: "localhost",
|
||||||
EnablePprof: false,
|
|
||||||
Host: "0.0.0.0",
|
Host: "0.0.0.0",
|
||||||
KeyFile: filepath.Join("https", "key.pem"),
|
KeyFile: filepath.Join("https", "key.pem"),
|
||||||
Port: "3000",
|
Port: "3000",
|
||||||
|
|
6
main.go
6
main.go
|
@ -101,17 +101,13 @@ var (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var cpuProfilePath, memProfilePath string
|
||||||
cpuProfilePath, memProfilePath string
|
|
||||||
enablePprof bool
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:embed assets/*
|
//go:embed assets/*
|
||||||
var staticFS embed.FS
|
var staticFS embed.FS
|
||||||
|
|
||||||
//nolint:gochecknoinits
|
//nolint:gochecknoinits
|
||||||
func init() {
|
func init() {
|
||||||
flag.BoolVar(&enablePprof, "pprof", false, "enable pprof mode")
|
|
||||||
flag.StringVar(&cpuProfilePath, "cpuprofile", "", "set path to saving CPU memory profile")
|
flag.StringVar(&cpuProfilePath, "cpuprofile", "", "set path to saving CPU memory profile")
|
||||||
flag.StringVar(&memProfilePath, "memprofile", "", "set path to saving pprof memory profile")
|
flag.StringVar(&memProfilePath, "memprofile", "", "set path to saving pprof memory profile")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
Loading…
Reference in New Issue