mirror of
https://github.com/numtide/treefmt.git
synced 2024-10-05 21:17:37 +03:00
fix: remove setting of cpu profile rate
Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
parent
b7458e6530
commit
f1f56d1bfc
@ -42,9 +42,6 @@ var (
|
||||
func (f *Format) Run() (err error) {
|
||||
// cpu profiling
|
||||
if Cli.CpuProfile != "" {
|
||||
// it is not recommended to go over 500 hz, but anything less wasn't producing meaningful samples
|
||||
runtime.SetCPUProfileRate(500)
|
||||
|
||||
cpuProfile, err := os.Create(Cli.CpuProfile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open file for writing cpu profile: %w", err)
|
||||
|
@ -37,9 +37,8 @@ func TestCpuProfile(t *testing.T) {
|
||||
_, err = cmd(t, "-C", tempDir, "--allow-missing-formatter", "--cpu-profile", "cpu.pprof")
|
||||
as.NoError(err)
|
||||
as.FileExists(filepath.Join(tempDir, "cpu.pprof"))
|
||||
file, err := os.Stat(filepath.Join(tempDir, "cpu.pprof"))
|
||||
_, err = os.Stat(filepath.Join(tempDir, "cpu.pprof"))
|
||||
as.NoError(err)
|
||||
as.False(file.Size() == 0)
|
||||
}
|
||||
|
||||
func TestAllowMissingFormatter(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user