From 959ce30374ffbb16a3cb37979eabba76a727730d Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Thu, 17 Jul 2014 02:33:27 +0700 Subject: [PATCH] Show Kyoto Cabinet configuration with /debug --- server.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index c5f62a1..1db30d0 100644 --- a/server.go +++ b/server.go @@ -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) }