mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-13 22:38:36 -07:00
Go routine stat
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"runtime"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
|
||||
@@ -43,6 +44,8 @@ func (s *Server) stats(w http.ResponseWriter, r *http.Request, p httprouter.Para
|
||||
var val interface{}
|
||||
query := r.URL.Query()
|
||||
|
||||
stats.DefaultStats.GoRoutines = runtime.NumGoroutine()
|
||||
|
||||
if _, flatten := query["flatten"]; flatten {
|
||||
val = stats.DefaultStats.Flattened()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user