Skip to content

Commit

Permalink
profilex: Do watch for shutdown signal on profiling (ory#28)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
  • Loading branch information
kminehart authored and aeneasr committed Mar 17, 2019
1 parent b9d1b00 commit e8fce87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions profilex/profiling.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ func Profile() interface {
} {
switch os.Getenv("PROFILING") {
case "cpu":
return profile.Start(profile.CPUProfile)
return profile.Start(profile.CPUProfile, profile.NoShutdownHook)
case "mem":
return profile.Start(profile.MemProfile)
return profile.Start(profile.MemProfile, profile.NoShutdownHook)
case "mutex":
return profile.Start(profile.MutexProfile)
return profile.Start(profile.MutexProfile, profile.NoShutdownHook)
case "block":
return profile.Start(profile.BlockProfile)
return profile.Start(profile.BlockProfile, profile.NoShutdownHook)
}
return new(noop)
}

// HelpMessage returns a string explaining how profiling works.
func HelpMessage() string {
return `- PROFILING: Set "PROFILING=cpu" to enable cpu profiling and "PROFILING=memory" to enable memory profiling.
It is not possible to do both at the same time. DProfiling is disabled per default.
return `- PROFILING: Set "PROFILING=cpu" to enable cpu profiling and "PROFILING=mem" to enable memory profiling.
It is not possible to do both at the same time. Profiling is disabled per default.
Example: PROFILING=cpu`
}

0 comments on commit e8fce87

Please sign in to comment.