Added profiling for mttilemapper.

This commit is contained in:
Sascha L. Teichmann 2014-10-28 11:51:45 +01:00
parent 121a046eee
commit 6afed94154
1 changed files with 13 additions and 0 deletions

View File

@ -10,6 +10,8 @@ import (
"image"
"image/color"
"log"
"os"
"runtime/pprof"
"bitbucket.org/s_l_teichmann/mtsatellite/common"
)
@ -24,6 +26,7 @@ func main() {
outfile string
shaded bool
transparent bool
cpuProfile string
)
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
@ -43,9 +46,19 @@ func main() {
flag.StringVar(&outfile, "o", "out.png", "image file of result (shorthand)")
flag.BoolVar(&shaded, "shaded", true, "draw relief")
flag.BoolVar(&transparent, "transparent", false, "render transparent blocks")
flag.StringVar(&cpuProfile, "cpuprofile", "", "write cpu profile to file")
flag.Parse()
if cpuProfile != "" {
f, err := os.Create(cpuProfile)
if err != nil {
log.Fatal(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
}
var err error
var colors *common.Colors