mirror of
https://github.com/1f349/violet.git
synced 2024-11-09 22:22:50 +00:00
Record the number of currently running goroutines
This commit is contained in:
parent
869d114891
commit
8c4aa67e7b
@ -11,6 +11,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ import (
|
|||||||
// endpoints for the reverse proxy.
|
// endpoints for the reverse proxy.
|
||||||
func NewHttpsServer(conf *conf.Conf) *http.Server {
|
func NewHttpsServer(conf *conf.Conf) *http.Server {
|
||||||
r := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
r := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||||
log.Printf("[Debug] Request: %s - '%s' - '%s' - '%s' - len: %d\n", req.Method, req.URL.String(), req.RemoteAddr, req.Host, req.ContentLength)
|
log.Printf("[Debug] Request: %s - '%s' - '%s' - '%s' - len: %d - thread: %d\n", req.Method, req.URL.String(), req.RemoteAddr, req.Host, req.ContentLength, runtime.NumGoroutine())
|
||||||
conf.Router.ServeHTTP(rw, req)
|
conf.Router.ServeHTTP(rw, req)
|
||||||
})
|
})
|
||||||
favMiddleware := setupFaviconMiddleware(conf.Favicons, r)
|
favMiddleware := setupFaviconMiddleware(conf.Favicons, r)
|
||||||
|
Loading…
Reference in New Issue
Block a user