This library provides single entry point to all profiling functionality available in golang 1.5. StartProfiling starts writing trace and cpu profile to some random directory it creates before running.
When you call StopProfiling it writes heap profile to the same directory as well as stopping current profiling.
Logging
By default, the library writes logs about start/stop profiling and errors using standard go logger. You can provide
your own log function in order to make it fit your logging or shut up the logging at all.
We don't use much log levels since all the messages have quite the same level.
StartProfiling starts writing profiles and returns path to the directory where they will be placed
if anything goes wrong corresponding error is returned and no profiling is started
If writing profiles is in progress it returns an error
StopProfiling stops writing all profiles. Before stopping it tries to write a heap dump
to the same folder where the other profiles are kept. It returns path to the folder which contains profiling files
If profiling is not in progress, this method does nothing and returns empty string