mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-11 17:30:18 +01:00
Added profiling for mttilemapper.
This commit is contained in:
parent
121a046eee
commit
6afed94154
@ -10,6 +10,8 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"image/color"
|
"image/color"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
|
"runtime/pprof"
|
||||||
|
|
||||||
"bitbucket.org/s_l_teichmann/mtsatellite/common"
|
"bitbucket.org/s_l_teichmann/mtsatellite/common"
|
||||||
)
|
)
|
||||||
@ -24,6 +26,7 @@ func main() {
|
|||||||
outfile string
|
outfile string
|
||||||
shaded bool
|
shaded bool
|
||||||
transparent bool
|
transparent bool
|
||||||
|
cpuProfile string
|
||||||
)
|
)
|
||||||
|
|
||||||
flag.IntVar(&port, "port", 6379, "port to of mtredisalize server")
|
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.StringVar(&outfile, "o", "out.png", "image file of result (shorthand)")
|
||||||
flag.BoolVar(&shaded, "shaded", true, "draw relief")
|
flag.BoolVar(&shaded, "shaded", true, "draw relief")
|
||||||
flag.BoolVar(&transparent, "transparent", false, "render transparent blocks")
|
flag.BoolVar(&transparent, "transparent", false, "render transparent blocks")
|
||||||
|
flag.StringVar(&cpuProfile, "cpuprofile", "", "write cpu profile to file")
|
||||||
|
|
||||||
flag.Parse()
|
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 err error
|
||||||
var colors *common.Colors
|
var colors *common.Colors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user