profile

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProfileTypeEnum enum of profiling options
	ProfileTypeEnum = enummap.NewEnumMapOrPanic(map[string]int{
		"cpu":          int(ProfileTypeCPU),
		"block":        int(ProfileTypeBlock),
		"goroutine":    int(ProfileTypeGoRoutine),
		"threadcreate": int(ProfileTypeTreadCreate),
		"heap":         int(ProfileTypeHeap),
		"mutex":        int(ProfileTypeMutex),
		"trace":        int(ProfileTypeTrace),
		"mem":          int(ProfileTypeMem),
	})
)

Functions

func Close

func Close() error

Close profiler, registered close functions will be executed LIFO

func Help

func Help() string

Help formats a string to be displayed as help

func StartBlockProfiler

func StartBlockProfiler(file string, debug int) error

StartBlockProfiler and save to file, debug flag adds stacks to profile

func StartCPUProfiler

func StartCPUProfiler(file string) error

StartCPUProfiler and save to file

func StartGoroutineProfiler

func StartGoroutineProfiler(fileprefix string, t time.Duration) error

StartGoroutineProfiler and save to a fileprefix_%i.out file each t

func StartHeapProfiler

func StartHeapProfiler(file string) error

StartHeapProfiler and save to file

func StartMemProfiler

func StartMemProfiler(file string) error

StartMemProfiler and save to file

func StartMutexProfiler

func StartMutexProfiler(file string, debug int) error

StartMutexProfiler and save to file, debug flag adds stacks to profile

func StartProfiler

func StartProfiler(typ ProfileType) error

StartProfiler start profiler of type (typ) with default parameters

func StartThreadCreateProfiler

func StartThreadCreateProfiler(file string) error

StartThreadCreateProfiler and save to file

func StartTraceProfiler

func StartTraceProfiler(file string) error

StartTraceProfiler and save to file

Types

type ProfileType

type ProfileType int
const (
	ProfileTypeUnknown ProfileType = iota // Default value of int
	ProfileTypeCPU
	ProfileTypeBlock
	ProfileTypeGoRoutine
	ProfileTypeTreadCreate
	ProfileTypeHeap
	ProfileTypeMutex
	ProfileTypeTrace
	ProfileTypeMem
)

func ResolveParameter

func ResolveParameter(param string) (ProfileType, error)

ResolveParameter of string or int to profiletype

Jump to

Keyboard shortcuts

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