Skip to content

Commit 9f46598

Browse files
authored
Make the profiler easier to use (#5068)
1 parent a814b5d commit 9f46598

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/profiling.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ var globalProfilers []profiler
114114
func enableProfilers(outputFolder string, profilers []string) error {
115115
now := time.Now().Format("2006-01-02T15-04-05")
116116

117+
if _, e := os.Stat(outputFolder); e != nil {
118+
if e := os.MkdirAll(outputFolder, 0o700); e != nil {
119+
return e
120+
}
121+
}
122+
117123
for _, profilerName := range profilers {
118124
outputFile := path.Join(outputFolder, profilerName+"."+now)
119125
f, e := os.Create(outputFile)

0 commit comments

Comments
 (0)