From b3769056e735e0045dc5cf80ec5e1c5e887be8dd Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Tue, 17 Jan 2023 18:17:28 +0700 Subject: [PATCH] feat: add profiler --- .gitignore | 1 + internal/cli/action.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ce03dee..887c5e2 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ # Go coverage.out vendor +*.prof # GoReleaser dist diff --git a/internal/cli/action.go b/internal/cli/action.go index 5b91a6d..1204159 100644 --- a/internal/cli/action.go +++ b/internal/cli/action.go @@ -55,7 +55,7 @@ func (a *action) Run(c *cli.Context) error { } if a.flags.profiler { - f, err := os.Create("cpuprofile") + f, err := os.Create("cpu.prof") if err != nil { return fmt.Errorf("os: failed to create: %w", err) } @@ -84,7 +84,7 @@ func (a *action) Run(c *cli.Context) error { } if a.flags.profiler { - f, err := os.Create("memprofile") + f, err := os.Create("mem.prof") if err != nil { return fmt.Errorf("os: failed to create: %w", err) }