Add pprof server endpoint (optional, default off)
This commit is contained in:
@@ -18,6 +18,7 @@ type Config struct {
|
||||
TLSCert string // TLS certificate file
|
||||
TLSKey string // TLS key file
|
||||
MaxResponseSize int // Max response size in bytes
|
||||
PprofAddr string // Address for pprof HTTP endpoint (empty = disabled)
|
||||
}
|
||||
|
||||
var CONFIG Config //nolint:gochecknoglobals
|
||||
@@ -49,6 +50,7 @@ func GetConfig() *Config {
|
||||
tlsCert := flag.String("tls-cert", "certs/server.crt", "TLS certificate file")
|
||||
tlsKey := flag.String("tls-key", "certs/server.key", "TLS key file")
|
||||
maxResponseSize := flag.Int("max-response-size", 5_242_880, "Max response size in bytes")
|
||||
pprofAddr := flag.String("pprof-addr", "", "Address for pprof HTTP endpoint (empty = disabled)")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
@@ -74,5 +76,6 @@ func GetConfig() *Config {
|
||||
TLSCert: *tlsCert,
|
||||
TLSKey: *tlsKey,
|
||||
MaxResponseSize: *maxResponseSize,
|
||||
PprofAddr: *pprofAddr,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user