Profiling: Add base, fix memory profiling (#8850)

For 'snapshot' type profiles, record a 'before' profile that can be used 
as `go tool pprof -base=before ...` to compare before and after.

"Before" profiles are included in the zipped package.

[`runtime.MemProfileRate`](https://golang.org/pkg/runtime/#pkg-variables) 
should not be updated while the application is running, so we set it at startup.

Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
Klaus Post
2020-01-22 00:49:25 +01:00
committed by Harshavardhana
parent f14f60a487
commit c7178d2066
4 changed files with 61 additions and 20 deletions
+2 -4
View File
@@ -30,10 +30,8 @@ func handleSignals() {
// If global profiler is set stop before we exit.
globalProfilerMu.Lock()
defer globalProfilerMu.Unlock()
if len(globalProfiler) > 0 {
for _, p := range globalProfiler {
p.Stop()
}
for _, p := range globalProfiler {
p.Stop()
}
if success {