Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BlockProfileFlag string
BlockProfileFlag is a filename to write the stack traces that caused blocking on synchronization primitives.
var CPUProfileFlag string
CPUProfileFlag is a filename to write a CPU profile.
var HeapProfileFlag string
HeapProfileFlag is a filename to write a heap profile.
var ThreadProfileFlag string
ThreadProfileFlag is a filename to write the stack traces that caused new OS threads to be created.
Functions ¶
func Close ¶
func Close()
Close finishes the profiles and closes their files. Close should be run at the end of the program's execution, possibly through a defer statement in the main method.
func Init ¶
func Init() error
Init creates the files named by any of the *ProfileFlag variables. If an error is returned, the program can still function, but the file that failed to open and any further files will not contain profiles. Close must still be called at the end of the program, however, as earlier profiles are not cancelled by later profiles failing.
func RegisterFlags ¶
RegisterFlags must be called before Init and before f.Parse. If you are not allocating your own FlagSet, pass flag.CommandLine as the argument. If you are using a different command line argument parsing package, you will need to assign the values of *ProfileFlag on your own.
Types ¶
This section is empty.