support pprof (#2849)

This commit is contained in:
fatedier
2022-03-17 11:42:59 +08:00
committed by GitHub
parent 37c27169ac
commit 63efa6b776
6 changed files with 40 additions and 4 deletions

View File

@@ -151,6 +151,9 @@ type ClientCommonConf struct {
UDPPacketSize int64 `ini:"udp_packet_size" json:"udp_packet_size"`
// Include other config files for proxies.
IncludeConfigFiles []string `ini:"includes" json:"includes"`
// Enable golang pprof handlers in admin listener.
// Admin port must be set first.
PprofEnable bool `ini:"pprof_enable" json:"pprof_enable"`
}
// GetDefaultClientConf returns a client configuration with default values.
@@ -188,6 +191,7 @@ func GetDefaultClientConf() ClientCommonConf {
Metas: make(map[string]string),
UDPPacketSize: 1500,
IncludeConfigFiles: make([]string, 0),
PprofEnable: false,
}
}

View File

@@ -167,6 +167,9 @@ type ServerCommonConf struct {
// UDPPacketSize specifies the UDP packet size
// By default, this value is 1500
UDPPacketSize int64 `ini:"udp_packet_size" json:"udp_packet_size"`
// Enable golang pprof handlers in dashboard listener.
// Dashboard port must be set first.
PprofEnable bool `ini:"pprof_enable" json:"pprof_enable"`
}
// GetDefaultServerConf returns a server configuration with reasonable
@@ -210,6 +213,7 @@ func GetDefaultServerConf() ServerCommonConf {
Custom404Page: "",
HTTPPlugins: make(map[string]plugin.HTTPPluginOptions),
UDPPacketSize: 1500,
PprofEnable: false,
}
}