added profiling flag and kill channel

This commit is contained in:
sm
2013-09-28 23:00:29 -07:00
parent 83da3961cd
commit bd4cb39828
2 changed files with 22 additions and 0 deletions
+11
View File
@@ -2,7 +2,9 @@ package main
import (
"encoding/json"
"log"
"net/http"
"runtime/pprof"
"strings"
)
@@ -80,3 +82,12 @@ func stopGame(w http.ResponseWriter, req *http.Request) {
}
gameid.kill <- true
}
func killServer(w http.ResponseWriter, req *http.Request) {
if *profile != "" {
log.Print("trying to stop cpu profile")
pprof.StopCPUProfile()
log.Print("stopped cpu profile")
}
log.Fatal("shit got fucked up")
}