Allow enabling mutex and block profiles (#1073)

This commit is contained in:
Frederic Branczyk 2017-11-02 12:18:45 +01:00 committed by stuart nelson
parent 53bd897bd0
commit 029c70d6fe
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import (
"os"
"os/signal"
"path/filepath"
"runtime"
"sort"
"strconv"
"strings"
@ -103,6 +104,11 @@ func newMarkerMetrics(marker types.Marker) {
}
func main() {
if os.Getenv("DEBUG") != "" {
runtime.SetBlockProfileRate(20)
runtime.SetMutexProfileFraction(20)
}
var (
showVersion = flag.Bool("version", false, "Print version information.")