profiling

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2018 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CPUFilename = "status_cpu.prof"

CPUFilename is a filename in which the CPU profiling is stored.

View Source
const MemFilename = "status_mem.prof"

MemFilename is a filename in which the memory profiling is stored.

Variables

This section is empty.

Functions

func StartCPUProfile

func StartCPUProfile(dataDir string) error

StartCPUProfile enables CPU profiling for the current process. While profiling, the profile will be buffered and written to the file in folder dataDir.

func StopCPUProfile

func StopCPUProfile() error

StopCPUProfile stops the current CPU profile, if any, and closes the file.

func WriteHeapFile

func WriteHeapFile(dataDir string) error

WriteHeapFile writes heap memory to the file.

Types

type Profiler

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

Profiler runs and controls a HTTP pprof interface.

func NewProfiler

func NewProfiler(port int) *Profiler

NewProfiler creates an instance of the profiler with the given port.

func (*Profiler) Go

func (p *Profiler) Go()

Go starts the HTTP pprof in the background.

Jump to

Keyboard shortcuts

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