Restore server status handler
This commit is contained in:
parent
2a0d88c3bb
commit
c7b4f74333
21
server.go
21
server.go
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -22,23 +23,9 @@ func startServer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func statusHandler(w http.ResponseWriter, r *http.Request) {
|
func statusHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
// info := make(map[string]map[string]uint)
|
info := theHub.Info()
|
||||||
|
jsn, _ := json.Marshal(info)
|
||||||
// for _, q := range queues {
|
w.Write(jsn)
|
||||||
// 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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func debugHandler(w http.ResponseWriter, r *http.Request) {
|
func debugHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
Loading…
Reference in New Issue