MCPcopy Create free account
hub / github.com/CPChain/chain / StartPProf

Function StartPProf

internal/debug/flags.go:105–116  ·  view source on GitHub ↗
(address string)

Source from the content-addressed store, hash-verified

103}
104
105func StartPProf(address string) {
106 // Hook go-metrics into expvar on any /debug/metrics request, load all vars
107 // from the registry into expvar, and execute regular expvar handler.
108 exp.Exp(metrics.DefaultRegistry)
109 http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize))
110 log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address))
111 go func() {
112 if err := http.ListenAndServe(address, nil); err != nil {
113 log.Error("Failure in running pprof server", "err", err)
114 }
115 }()
116}
117
118// Exit stops all running profiles, flushing their output to the
119// respective file.

Callers 1

SetupFunction · 0.85

Calls 3

HandleMethod · 0.80
InfoMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected