Documentation
¶
Overview ¶
Package profiler implements functions to start a handler
Package profiler implements functions to start a handler
Index ¶
Constants ¶
View Source
const ( InfoEvent = iota ErrorEvent )
Event types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶ added in v0.2.0
EventHandler function to handle log events
func DefaultEventHandler ¶ added in v0.2.0
func DefaultEventHandler() EventHandler
type Hooker ¶
type Hooker interface {
// PreStart will be executed after the signal was received but before the debug endpoint starts
PreStart()
// PostShutdown will be executed after the debug endpoint is shutdown or the start has failed
PostShutdown()
}
Hooker represents the interface for Profiler hooks
type Option ¶ added in v0.2.0
type Option func(*Profiler)
Option is a Profiler functional option
func WithAddress ¶
WithAddress sets the listen address of the pprof handler
func WithEventHandler ¶ added in v0.2.0
func WithEventHandler(evt EventHandler) Option
WithEventHandler registers a custom event handler
func WithSignal ¶
WithSignal sets the signal to activate the pprof handler
func WithTimeout ¶
WithTimeout sets the timeout after the pprof handler will be shutdown
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler represents the Profiler
func New ¶
New returns a new profiler Defaults: - Signal : syscall.SIGUSR1 - Address: ":6666" - Timeout: 30m
Click to show internal directories.
Click to hide internal directories.