Clean up cpuio profiling (#14838)

Don't start regular cpu profile as well. Use bed madmin const.
This commit is contained in:
Klaus Post 2022-04-29 09:35:42 -07:00 committed by GitHub
parent 96f27a4965
commit 13ba4b433d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,8 +320,7 @@ func startProfiler(profilerType string) (minioProfiler, error) {
defer os.RemoveAll(dirPath) defer os.RemoveAll(dirPath)
return ioutil.ReadFile(fn) return ioutil.ReadFile(fn)
} }
// TODO(klauspost): Replace with madmin.ProfilerCPUIO on next update. case madmin.ProfilerCPUIO:
case "cpuio":
// at 10k or more goroutines fgprof is likely to become // at 10k or more goroutines fgprof is likely to become
// unable to maintain its sampling rate and to significantly // unable to maintain its sampling rate and to significantly
// degrade the performance of your application // degrade the performance of your application
@ -339,10 +338,6 @@ func startProfiler(profilerType string) (minioProfiler, error) {
return nil, err return nil, err
} }
stop := fgprof.Start(f, fgprof.FormatPprof) stop := fgprof.Start(f, fgprof.FormatPprof)
err = pprof.StartCPUProfile(f)
if err != nil {
return nil, err
}
prof.stopFn = func() ([]byte, error) { prof.stopFn = func() ([]byte, error) {
err := stop() err := stop()
if err != nil { if err != nil {