1
0
Fork 0

Show Kyoto Cabinet configuration with /debug

This commit is contained in:
Gregory Eremin 2014-07-17 02:33:27 +07:00
parent eb4e6e8772
commit 959ce30374
1 changed files with 7 additions and 1 deletions

View File

@ -29,9 +29,15 @@ func StatusHandler(w http.ResponseWriter, r *http.Request) {
}
func DebugHandler(w http.ResponseWriter, r *http.Request) {
info := make(map[string]int)
info := make(map[string]interface{})
info["goroutines"] = runtime.NumGoroutine()
s, err := storage.Status()
if err != nil {
Error(err, "Failed to get Kyoto Cabinet status")
}
info["kyoto_cabinet"] = s
jsn, _ := json.Marshal(info)
w.Write(jsn)
}