NewHandler returns a http handler allowing the profiler to be exposed on a pprof-compatible http endpoint. The sample rate is a value between 0 and 1 used to scale the profile results based on the sampling rate applied to the profiler so the resulting values remain representative. The symbolizer p
(sampleRate float64)
| 166 | // The symbolizer passed as argument is used to resolve names of program |
| 167 | // locations recorded in the profile. |
| 168 | func (p *MemoryProfiler) NewHandler(sampleRate float64) http.Handler { |
| 169 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 170 | serveProfile(w, p.NewProfile(sampleRate)) |
| 171 | }) |
| 172 | } |
| 173 | |
| 174 | // NewFunctionListener returns a function listener suited to install a hook on |
| 175 | // functions responsible for memory allocation. |
nothing calls this directly
no test coverage detected