Documentation ¶
Overview ¶
package profiling provides support for easily doing CPU and memory profiling from within Go programs.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start starts profiling, saving cpu and memory profiles to the specified cpu and mem filenames. To disable cpu/mem profiling, specify blank strings for the cpu and/or mem filenames.
Note - timestamps will be automatically added to the filenames to ensure uniqueness. For example "mem.prof" becomes "mem_20150119_080853.639750789.prof".
Start returns a function that finishes profiling. It can be useful to call in a defer in your main method, for example.
Start also installs a handler for SIGINT that saves profiling information if the process receives a SIGINT.
Example ¶
finishProfiling := profiling.Start("cpu.prof", "mem.prof") defer finishProfiling()
Output:
Types ¶
This section is empty.