Skip to content

Commit

Permalink
Make the profiler easier to use (#5068)
Browse files Browse the repository at this point in the history
  • Loading branch information
dormanze authored Oct 29, 2024
1 parent a814b5d commit 9f46598
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/profiling.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ var globalProfilers []profiler
func enableProfilers(outputFolder string, profilers []string) error {
now := time.Now().Format("2006-01-02T15-04-05")

if _, e := os.Stat(outputFolder); e != nil {
if e := os.MkdirAll(outputFolder, 0o700); e != nil {
return e
}
}

for _, profilerName := range profilers {
outputFile := path.Join(outputFolder, profilerName+"."+now)
f, e := os.Create(outputFile)
Expand Down

0 comments on commit 9f46598

Please sign in to comment.