Enable multiple concurrent profile types (#8792)

This commit is contained in:
Klaus Post
2020-01-11 02:19:58 +01:00
committed by kannappanr
parent 686d4656de
commit 2bf6cf0e15
8 changed files with 202 additions and 128 deletions

View File

@@ -28,8 +28,12 @@ func handleSignals() {
// Custom exit function
exit := func(success bool) {
// If global profiler is set stop before we exit.
if globalProfiler != nil {
globalProfiler.Stop()
globalProfilerMu.Lock()
defer globalProfilerMu.Unlock()
if len(globalProfiler) > 0 {
for _, p := range globalProfiler {
p.Stop()
}
}
if success {