mirror of
				https://bitbucket.org/s_l_teichmann/mtsatellite
				synced 2025-11-04 09:55:34 +01:00 
			
		
		
		
	Added profiling for mttilemapper.
This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user