debug

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2019 License: GPL-3.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handler = new(HandlerT)

Handler is the global debugging handler.

Functions

This section is empty.

Types

type HandlerT

type HandlerT struct {
	// contains filtered or unexported fields
}

HandlerT implements the debugging API. Do not create values of this type, use the one in the Handler variable instead.

func (*HandlerT) BlockProfile

func (*HandlerT) BlockProfile(file string, nsec uint) error

BlockProfile turns on CPU 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 (*HandlerT) CpuProfile

func (h *HandlerT) CpuProfile(file string, nsec uint) error

CpuProfile turns on CPU profiling for nsec seconds and writes profile data to file.

func (*HandlerT) FreeOSMemory

func (*HandlerT) FreeOSMemory()

FreeOSMemory returns unused memory to the OS.

func (*HandlerT) GcStats

func (*HandlerT) GcStats() *debug.GCStats

GcStats returns GC statistics.

func (*HandlerT) GoTrace

func (h *HandlerT) GoTrace(file string, nsec uint) error

GoTrace turns on tracing for nsec seconds and writes trace data to file.

func (*HandlerT) MemStats

func (*HandlerT) MemStats() *runtime.MemStats

MemStats returns detailed runtime memory statistics.

func (*HandlerT) SetBlockProfileRate

func (*HandlerT) SetBlockProfileRate(rate int)

SetBlockProfileRate sets the rate of goroutine block profile data collection. rate 0 disables block profiling.

func (*HandlerT) SetGCPercent

func (*HandlerT) SetGCPercent(v int) int

SetGCPercent sets the garbage collection target percentage. It returns the previous setting. A negative value disables GC.

func (*HandlerT) Stacks

func (*HandlerT) Stacks() string

Stacks returns a printed representation of the stacks of all goroutines.

func (*HandlerT) StartCPUProfile

func (h *HandlerT) StartCPUProfile(file string) error

StartCPUProfile turns on CPU profiling, writing to the given file.

func (*HandlerT) StartGoTrace

func (h *HandlerT) StartGoTrace(file string) error

StartGoTrace turns on tracing, writing to the given file.

func (*HandlerT) StopCPUProfile

func (h *HandlerT) StopCPUProfile() error

StopCPUProfile stops an ongoing CPU profile.

func (*HandlerT) StopGoTrace

func (h *HandlerT) StopGoTrace() error

StopTrace stops an ongoing trace.

func (*HandlerT) WriteBlockProfile

func (*HandlerT) WriteBlockProfile(file string) error

WriteBlockProfile writes a goroutine blocking profile to the given file.

func (*HandlerT) WriteMemProfile

func (*HandlerT) 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL