mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-06 05:57:38 +03:00
feat: pprof
This commit is contained in:
parent
3b4af8035b
commit
531b23baa4
3 changed files with 39 additions and 8 deletions
app
22
app/pprof.go
Normal file
22
app/pprof.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
//go:build pprof
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
)
|
||||
|
||||
const (
|
||||
pprofListenAddr = ":6060"
|
||||
)
|
||||
|
||||
func init() {
|
||||
fmt.Printf("!!! pprof enabled, listening on %s\n", pprofListenAddr)
|
||||
go func() {
|
||||
if err := http.ListenAndServe(pprofListenAddr, nil); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue