Documentation ¶
Index ¶
- Variables
- func PrintTimes() string
- func ProcessProfileFlags(profile string) (string, error)
- func SaveMemProfile(profileDir, identifier string) error
- func StartCPUProfile(profileDir, identifier string) error
- func StartContinuousProfile(profileDir string, profileCPU bool, profileMem bool, profileTrace bool)
- func StartTrace(traceDir, identifier string) error
- func StopCPUProfile()
- func StopTrace()
- func ToggleTimer(s string)
- func Uptime() int64
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidProfileFlags is the error returned when there is an error parsing // the profile flags ErrInvalidProfileFlags = errors.New("Unable to parse --profile flags, unrecognized or duplicate flags") )
Functions ¶
func PrintTimes ¶
func PrintTimes() string
PrintTimes prints how much time, in milliseconds, has passed at each timer.
func ProcessProfileFlags ¶ added in v1.5.1
ProcessProfileFlags checks that the flags given for profiling are valid.
func SaveMemProfile ¶
SaveMemProfile saves the current memory structure of the program. An error will be returned if memory profiling is already in progress. Unlike for cpu profiling, there is no 'stopMemProfile' call - everything happens at once.
func StartCPUProfile ¶
StartCPUProfile starts cpu profiling. An error will be returned if a cpu profiler is already running.
func StartContinuousProfile ¶
StartContinuousProfile will continuously print statistics about the cpu usage, memory usage, and runtime stats of the program, and run an execution logger. Select one (recommended) or more functionalities by passing the corresponding flag(s)
func StartTrace ¶ added in v1.3.0
StartTrace starts trace. An error will be returned if a trace is already running.
func ToggleTimer ¶
func ToggleTimer(s string)
ToggleTimer actives a timer known by a given string. If the timer does not yet exist, it is created.
Types ¶
This section is empty.