Documentation ¶
Overview ¶
Package profiler is a simple abstraction for easily running runtime profiles and storing the results to files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProfileConfig ¶
type ProfileConfig struct { // List of selected Profiler Modes Modes []string `required:"false" split_words:"true" default:"Cpu,"` // Directory path to dump the profile output to. Default is current directory. DirPath string `required:"false" split_words:"true" default:"."` // Quiet disables info log output. Quiet bool `required:"false" split_words:"true" default:true` // NoShutdownHook controls whether the profiling package should // hook SIGINT to automatically Stop(). NoShutdownHook bool `required:"false" split_words:"true" default:true` // MemProfileRate is the rate for the memory profiler. Default is 4096. // To include every allocated block in the profile, set MemProfileRate to 1. MemProfileRate int `required:"false" split_words:"true" default:4096` // MemProfileType = heap or alloc. Default is heap. MemProfileType string `required:"false" split_words:"true" default:"heap"` }
func (*ProfileConfig) Specified ¶
func (c *ProfileConfig) Specified() bool
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
Profiler represents an active profiling session.
func New ¶
func New(c ProfileConfig) *Profiler
New returns a new Profiler. One or more modes can be provided in config. Configuration can be directly applied once `prof` is initiailized. eg: `prof.Path = "./output"`
type ProfilerMode ¶
type ProfilerMode int
const ( Block ProfilerMode = iota Cpu Goroutine Mem Mutex ThreadCreate Trace )
func NewProfilerMode ¶
func NewProfilerMode(s string) ProfilerMode
func (ProfilerMode) String ¶
func (i ProfilerMode) String() string
Click to show internal directories.
Click to hide internal directories.