Documentation ¶
Index ¶
- func ExpandHome(p string) string
- type HandlerT
- type InternalAPI
- func (a *InternalAPI) BlockProfile(file string, nsec uint) error
- func (a *InternalAPI) CpuProfile(file string, nsec uint) error
- func (a *InternalAPI) FreeOSMemory()
- func (a *InternalAPI) GcStats() *debug.GCStats
- func (a *InternalAPI) GoTrace(file string, nsec uint) error
- func (a *InternalAPI) MemStats() *runtime.MemStats
- func (a *InternalAPI) MutexProfile(file string, nsec uint) error
- func (a *InternalAPI) SetBlockProfileRate(rate int)
- func (a *InternalAPI) SetGCPercent(v int) int
- func (a *InternalAPI) SetMutexProfileFraction(rate int)
- func (a *InternalAPI) Stacks() string
- func (a *InternalAPI) StartCPUProfile(file string) error
- func (a *InternalAPI) StartGoTrace(file string) error
- func (a *InternalAPI) StopCPUProfile() error
- func (a *InternalAPI) StopGoTrace() error
- func (a *InternalAPI) WriteBlockProfile(file string) error
- func (a *InternalAPI) WriteMemProfile(file string) error
- func (a *InternalAPI) WriteMutexProfile(file string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandHome ¶
ExpandHome expands home directory in file paths. ~someuser/tmp will not be expanded.
Types ¶
type HandlerT ¶
type HandlerT struct {
// contains filtered or unexported fields
}
HandlerT keeps track of the cpu profiler and trace execution
type InternalAPI ¶
type InternalAPI struct {
// contains filtered or unexported fields
}
InternalAPI is the debug_ prefixed set of APIs in the Debug JSON-RPC spec.
func NewInternalAPI ¶
func NewInternalAPI( ctx *server.Context, ) *InternalAPI
NewInternalAPI creates an instance of the Debug API.
func (*InternalAPI) BlockProfile ¶
func (a *InternalAPI) BlockProfile(file string, nsec uint) error
BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.
func (*InternalAPI) CpuProfile ¶
func (a *InternalAPI) CpuProfile(file string, nsec uint) error
CpuProfile turns on CPU profiling for nsec seconds and writes profile data to file.
func (*InternalAPI) FreeOSMemory ¶
func (a *InternalAPI) FreeOSMemory()
FreeOSMemory forces a garbage collection.
func (*InternalAPI) GcStats ¶
func (a *InternalAPI) GcStats() *debug.GCStats
GcStats returns GC statistics.
func (*InternalAPI) GoTrace ¶
func (a *InternalAPI) GoTrace(file string, nsec uint) error
GoTrace turns on tracing for nsec seconds and writes trace data to file.
func (*InternalAPI) MemStats ¶
func (a *InternalAPI) MemStats() *runtime.MemStats
MemStats returns detailed runtime memory statistics.
func (*InternalAPI) MutexProfile ¶
func (a *InternalAPI) MutexProfile(file string, nsec uint) error
MutexProfile turns on mutex profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.
func (*InternalAPI) SetBlockProfileRate ¶
func (a *InternalAPI) SetBlockProfileRate(rate int)
SetBlockProfileRate sets the rate of goroutine block profile data collection. rate 0 disables block profiling.
func (*InternalAPI) SetGCPercent ¶
func (a *InternalAPI) SetGCPercent(v int) int
SetGCPercent sets the garbage collection target percentage. It returns the previous setting. A negative value disables GC.
func (*InternalAPI) SetMutexProfileFraction ¶
func (a *InternalAPI) SetMutexProfileFraction(rate int)
SetMutexProfileFraction sets the rate of mutex profiling.
func (*InternalAPI) Stacks ¶
func (a *InternalAPI) Stacks() string
Stacks returns a printed representation of the stacks of all goroutines.
func (*InternalAPI) StartCPUProfile ¶
func (a *InternalAPI) StartCPUProfile(file string) error
StartCPUProfile turns on CPU profiling, writing to the given file.
func (*InternalAPI) StartGoTrace ¶
func (a *InternalAPI) StartGoTrace(file string) error
StartGoTrace turns on tracing, writing to the given file.
func (*InternalAPI) StopCPUProfile ¶
func (a *InternalAPI) StopCPUProfile() error
StopCPUProfile stops an ongoing CPU profile.
func (*InternalAPI) StopGoTrace ¶
func (a *InternalAPI) StopGoTrace() error
StopGoTrace stops an ongoing trace.
func (*InternalAPI) WriteBlockProfile ¶
func (a *InternalAPI) WriteBlockProfile(file string) error
WriteBlockProfile writes a goroutine blocking profile to the given file.
func (*InternalAPI) WriteMemProfile ¶
func (a *InternalAPI) WriteMemProfile(file string) error
WriteMemProfile writes an allocation profile to the given file. Note that the profiling rate cannot be set through the API, it must be set on the command line.
func (*InternalAPI) WriteMutexProfile ¶
func (a *InternalAPI) WriteMutexProfile(file string) error
WriteMutexProfile writes a goroutine blocking profile to the given file.