MCPcopy Create free account
hub / github.com/ethereum/node-crawler / StartPProf

Function StartPProf

cmd/crawler/setup.go:134–147  ·  view source on GitHub ↗
(address string, withMetrics bool)

Source from the content-addressed store, hash-verified

132}
133
134func StartPProf(address string, withMetrics bool) {
135 // Hook go-metrics into expvar on any /debug/metrics request, load all vars
136 // from the registry into expvar, and execute regular expvar handler.
137 if withMetrics {
138 exp.Exp(metrics.DefaultRegistry)
139 }
140 http.Handle("/memsize/", http.StripPrefix("/memsize", &Memsize))
141 log.Info("Starting pprof server", "addr", fmt.Sprintf("http://%s/debug/pprof", address))
142 go func() {
143 if err := http.ListenAndServe(address, nil); err != nil {
144 log.Error("Failure in running pprof server", "err", err)
145 }
146 }()
147}

Callers 1

SetupFunction · 0.85

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected