profiling: Fix crash when enabling goroutines profiling (#9097)

This commit replaces 'goroutines' with 'goroutine' when passing it
to pprof library when activating goroutine type profiling
This commit is contained in:
Anis Elleuch 2020-03-06 13:22:47 -08:00 committed by GitHub
parent 75a0661213
commit 23a0415eb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -324,10 +324,10 @@ func startProfiler(profilerType string) (minioProfiler, error) {
}
case madmin.ProfilerGoroutines:
prof.ext = "txt"
prof.recordBase("goroutines", 1)
prof.recordBase("goroutine", 1)
prof.stopFn = func() ([]byte, error) {
var buf bytes.Buffer
err := pprof.Lookup("goroutines").WriteTo(&buf, 1)
err := pprof.Lookup("goroutine").WriteTo(&buf, 1)
return buf.Bytes(), err
}
case madmin.ProfilerTrace: