Documentation
¶
Overview ¶
Package profserver provides HTTP server for profiling (pprof is used under the hood).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config represents a set of configuration parameters for profiling server.
func NewConfigWithKeyPrefix ¶
NewConfigWithKeyPrefix creates a new instance of the Config. Allows specifying key prefix which will be used for parsing configuration parameters.
func (*Config) KeyPrefix ¶
KeyPrefix returns a key prefix with which all configuration parameters should be presented.
func (*Config) Set ¶
func (c *Config) Set(dp config.DataProvider) error
Set sets profiling server configuration values from config.DataProvider.
func (*Config) SetProviderDefaults ¶
func (c *Config) SetProviderDefaults(dp config.DataProvider)
SetProviderDefaults sets default configuration values for profiling server in config.DataProvider.
type ProfServer ¶
type ProfServer struct {
URL string
HTTPServer *http.Server
Logger log.FieldLogger
// contains filtered or unexported fields
}
ProfServer represents HTTP server for profiling. pprof is used under the hood. It implements service.Unit interface.
func New ¶
func New(cfg *Config, logger log.FieldLogger) *ProfServer
New creates a new HTTP server (pprof) for profiling.
func (*ProfServer) Start ¶
func (s *ProfServer) Start(fatalError chan<- error)
Start starts profiling HTTP server in a blocking way. Supposed this methods will be called in a separate goroutine. If a fatal error occurs, it's sent into passed fatalError channel and should be processed outside.
func (*ProfServer) Stop ¶
func (s *ProfServer) Stop(gracefully bool) error
Stop stops profiling HTTP server (always in no gracefully way).