profiles

package
v0.0.0-...-6b73929 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Heap

func Heap(dir string) (err error)

Heap creates a heap profile in mem.pprof file in given directory. Directory might be non-existent, heap will create it if needed. NOTE: Given the runtime implementation this setting is global.

func StartCPU

func StartCPU(dir string, typ CPUType) (closeFn func() error, err error)

StartCPU starts CPU profiling. If no error is returned, it returns close function that stops and flushes profile to cpu.pprof or cpu.fgprof.pprof file in a given directory. Directory might be non-existent, heap will create it if needed. NOTE: Given the runtime implementation this setting is global.

func StartHeapRecording

func StartHeapRecording(everyAlloc bool)

StartHeapRecording is setting memory profile rate to default value of profiler sample every 512 KB allocated. If `everyAlloc` is true it sets profile rate to sample for every byte allocated. NOTE: Given the runtime implementation this setting is global.

func StartTrace

func StartTrace(dir string) (closeFn func() error, err error)

StartTrace starts tracingIf no error is returned, it returns close function that stops and flushes profile to trace.out file in a given directory. Directory might be non-existent, heap will create it if needed. NOTE: Given the runtime implementation this setting is global.

func StopHeapRecording

func StopHeapRecording()

StopHeapRecording stops heap recording, which will mean that allocation after this function will be not recorded in any heap profile until we resume it. NOTE: Given the runtime implementation this setting is global.

Types

type CPUType

type CPUType string
const (
	CPUTypeBuiltIn CPUType = "built-in"
	// CPUTypeFGProf represents enhanced https://github.com/felixge/fgprof CPU profiling.
	CPUTypeFGProf CPUType = "fgprof"
)

Jump to

Keyboard shortcuts

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