document profiling

This commit is contained in:
crapStone 2024-04-29 23:31:18 +02:00 committed by crapStone
parent 52bc59aee9
commit 368b7c9f41
3 changed files with 22 additions and 4 deletions

View file

@ -1,9 +1,10 @@
package server
import (
"log"
"net/http"
_ "net/http/pprof"
"github.com/rs/zerolog/log"
)
func StartProfilingServer(listeningAddress string) {
@ -12,7 +13,9 @@ func StartProfilingServer(listeningAddress string) {
Handler: http.DefaultServeMux,
}
log.Info().Msgf("Starting debug server on %s", listeningAddress)
go func() {
log.Fatal(server.ListenAndServe())
log.Fatal().Err(server.ListenAndServe()).Msg("Failed to start debug server")
}()
}