mirror of
https://github.com/zrepl/zrepl.git
synced 2025-06-12 04:47:36 +02:00
privatize pprofServer
This commit is contained in:
parent
89dc267780
commit
df6e1bc64d
@ -9,7 +9,7 @@ import (
|
|||||||
"net/http/pprof"
|
"net/http/pprof"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PProfServer struct {
|
type pprofServer struct {
|
||||||
cc chan PprofServerControlMsg
|
cc chan PprofServerControlMsg
|
||||||
state PprofServerControlMsg
|
state PprofServerControlMsg
|
||||||
listener net.Listener
|
listener net.Listener
|
||||||
@ -22,9 +22,9 @@ type PprofServerControlMsg struct {
|
|||||||
HttpListenAddress string
|
HttpListenAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPProfServer(ctx context.Context) *PProfServer {
|
func NewPProfServer(ctx context.Context) *pprofServer {
|
||||||
|
|
||||||
s := &PProfServer{
|
s := &pprofServer{
|
||||||
cc: make(chan PprofServerControlMsg),
|
cc: make(chan PprofServerControlMsg),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ func NewPProfServer(ctx context.Context) *PProfServer {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *PProfServer) controlLoop(ctx context.Context) {
|
func (s *pprofServer) controlLoop(ctx context.Context) {
|
||||||
outer:
|
outer:
|
||||||
for {
|
for {
|
||||||
|
|
||||||
@ -75,6 +75,6 @@ outer:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *PProfServer) Control(msg PprofServerControlMsg) {
|
func (s *pprofServer) Control(msg PprofServerControlMsg) {
|
||||||
s.cc <- msg
|
s.cc <- msg
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user