Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCPUUsage ¶
Measures average CPU usage in the given time window and returns it as a floating point number between 0 and 1. ATTENTION: Blocks for the duration of the time window!
func StartProfiler ¶
Starts the profiler. StopProfiler needs to be called to finish profiling. For valid profiler names see the "runtime" package documentation. This implementation supports "cpu" as a special name for CPU profiling The outFileName argument designates the name of the output file to which profile data will be written after profiler is stopped. The rate is used for setting the "block" and "mutex" profile rate / fraction. Ignored for other names.
func StopOnSignal ¶
Sets up a signal handler that calls StopProfiler when the specified OS signal occurs. This is useful for profiling if the program does not terminate gracefully, but is stopped using an OS signal. StopOnSignal() can be used in this case to still obtain the profiler data. If the exit flag is set to true, the signal handler will exit the process after stopping the profiler.
func StopProfiler ¶
func StopProfiler()
Stops all profilers started by StartProfiler() and dumps their output to their corresponding files.
Types ¶
This section is empty.