mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-28 07:22:00 +00:00
add option to start http server for profiling
This commit is contained in:
parent
ca9433e0ea
commit
52bc59aee9
3 changed files with 34 additions and 4 deletions
18
server/profiling.go
Normal file
18
server/profiling.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
)
|
||||
|
||||
func StartProfilingServer(listeningAddress string) {
|
||||
server := &http.Server{
|
||||
Addr: listeningAddress,
|
||||
Handler: http.DefaultServeMux,
|
||||
}
|
||||
|
||||
go func() {
|
||||
log.Fatal(server.ListenAndServe())
|
||||
}()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue