1
0
Fork 0

Restore server status handler

This commit is contained in:
Gregory Eremin 2014-09-11 23:13:53 +04:00
parent 2a0d88c3bb
commit c7b4f74333
1 changed files with 4 additions and 17 deletions

View File

@ -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) {