Skip to content

Commit

Permalink
command/debug: use trace.out instead of .prof
Browse files Browse the repository at this point in the history
More in line with golang docs.
  • Loading branch information
pearkes committed Oct 16, 2018
1 parent 52d467b commit 3bd84d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion command/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func (c *cmd) captureDynamic() error {
errCh <- err
}

err = ioutil.WriteFile(fmt.Sprintf("%s/trace.prof", timestampDir), trace, 0644)
err = ioutil.WriteFile(fmt.Sprintf("%s/trace.out", timestampDir), trace, 0644)
if err != nil {
errCh <- err
}
Expand Down
8 changes: 4 additions & 4 deletions command/debug/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ func TestDebugCommand_ProfilesExist(t *testing.T) {
t.Fatalf("should exit 0, got code: %d", code)
}

profiles := []string{"heap", "profile", "goroutine"}
profiles := []string{"heap.prof", "profile.prof", "goroutine.prof", "trace.out"}
// Glob ignores file system errors
for _, v := range profiles {
fs, _ := filepath.Glob(fmt.Sprintf("%s/*/%s.prof", outputPath, v))
fs, _ := filepath.Glob(fmt.Sprintf("%s/*/%s", outputPath, v))
if len(fs) == 0 {
t.Errorf("output data should exist for %s", v)
}
Expand Down Expand Up @@ -466,10 +466,10 @@ func TestDebugCommand_DebugDisabled(t *testing.T) {
t.Fatalf("should exit 0, got code: %d", code)
}

profiles := []string{"heap", "profile", "goroutine", "trace"}
profiles := []string{"heap.prof", "profile.prof", "goroutine.prof", "trace.out"}
// Glob ignores file system errors
for _, v := range profiles {
fs, _ := filepath.Glob(fmt.Sprintf("%s/*/%s.prof", outputPath, v))
fs, _ := filepath.Glob(fmt.Sprintf("%s/*/%s", outputPath, v))
if len(fs) > 0 {
t.Errorf("output data should not exist for %s", v)
}
Expand Down

0 comments on commit 3bd84d3

Please sign in to comment.