minotar/imgd — pull request #138 by lukegb (2014-12-29 01:34:37+00:00)
Title: Adds a signal handler and slightly more safety to the stats collector

The signal handler allows dumping some profiling information by sending the process either:
* `USR1` - block
* `USR2` - goroutine

This information is output to the system temporary directory in a randomly named file with the prefix of the type of report being dumped.

The stats collector has been changed to use a signal rather than incrementing counters internally. This is marginally more sane, in my opinion, and avoids potential race conditions with multiple threads attempting to increment counters.