From c7b4f74333eff04f7b8853c7e5d60205015a8d2b Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Thu, 11 Sep 2014 23:13:53 +0400 Subject: [PATCH] Restore server status handler --- server.go | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/server.go b/server.go index b59fd1d..e470860 100644 --- a/server.go +++ b/server.go @@ -1,6 +1,7 @@ package main import ( + "encoding/json" "fmt" "io/ioutil" "net/http" @@ -22,23 +23,9 @@ func startServer() { } func statusHandler(w http.ResponseWriter, r *http.Request) { - // info := make(map[string]map[string]uint) - - // for _, q := range queues { - // info[q.name] = map[string]uint{ - // // "messages": q.counter.distance(), - // "subscriptions": 0, - // } - // } - - // for _, r := range pool.requests { - // for _, q := range r.queues { - // info[q]["subscriptions"]++ - // } - // } - - // jsn, _ := json.Marshal(info) - // w.Write(jsn) + info := theHub.Info() + jsn, _ := json.Marshal(info) + w.Write(jsn) } func debugHandler(w http.ResponseWriter, r *http.Request) {