Last active
June 16, 2022 16:53
-
-
Save benmoss/e999764db7e036586c9abc20e515d076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cmd/imgpkg/imgpkg.go b/cmd/imgpkg/imgpkg.go | |
index 4d1ae1f..a025c5a 100644 | |
--- a/cmd/imgpkg/imgpkg.go | |
+++ b/cmd/imgpkg/imgpkg.go | |
@@ -8,6 +8,8 @@ import ( | |
"log" | |
"math/rand" | |
"os" | |
+ "runtime" | |
+ "runtime/pprof" | |
"time" | |
uierrs "github.com/cppforlife/go-cli-ui/errors" | |
@@ -26,6 +28,9 @@ func main() { | |
confUI := ui.NewConfUI(ui.NewNoopLogger()) | |
defer confUI.Flush() | |
+ runtime.SetBlockProfileRate(100_000_000) // WARNING: Can cause some CPU overhead | |
+ file, _ := os.Create("./block.pprof") | |
+ defer pprof.Lookup("block").WriteTo(file, 0) | |
command := cmd.NewDefaultImgpkgCmd(confUI) | |
err := command.Execute() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment