Report CPU/mem usage in GUI

This commit is contained in:
Jakob Borg
2014-01-10 00:09:27 +01:00
parent cb33f27f23
commit 832c0ffad0
5 changed files with 140 additions and 53 deletions

10
main.go
View File

@@ -10,6 +10,8 @@ import (
_ "net/http/pprof"
"os"
"path"
"runtime"
"runtime/debug"
"strconv"
"strings"
"time"
@@ -81,6 +83,14 @@ func main() {
os.Exit(0)
}
if len(os.Getenv("GOGC")) == 0 {
debug.SetGCPercent(25)
}
if len(os.Getenv("GOMAXPROCS")) == 0 {
runtime.GOMAXPROCS(runtime.NumCPU())
}
if len(opts.Debug.TraceModel) > 0 || opts.Debug.LogSource {
logger = log.New(os.Stderr, "", log.Lshortfile|log.Ldate|log.Ltime|log.Lmicroseconds)
}