From 52905ffb82409fca9665ada0c8da40e05b58b8be Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:49:34 +0000 Subject: [PATCH] Update PROFILING.md --- docs/PROFILING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/PROFILING.md b/docs/PROFILING.md index 136a757b9..b026a8aed 100644 --- a/docs/PROFILING.md +++ b/docs/PROFILING.md @@ -31,6 +31,8 @@ http://localhost:65432/debug/pprof/profile?seconds=30 The profile will run for the specified number of `seconds` and then will produce a result. +### Examine a profile using the Go toolchain + If you have Go installed and want to explore the profile, you can invoke `go tool pprof` to start the profile directly. The `-http=` parameter will instruct `go tool pprof` to start a web server providing a view of the captured profile: ``` @@ -39,6 +41,8 @@ go tool pprof -http=localhost:23456 http://localhost:65432/debug/pprof/profile?s You can then visit `http://localhost:23456` in your web browser to see a visual representation of the profile. Particularly usefully, in the "View" menu, you can select "Flame Graph" to see a proportional interactive graph of CPU usage. +### Download a profile to send to someone else + If you don't have the Go tools installed but just want to capture the profile to send to someone else, you can instead use `curl` to download the profiler results: ``` @@ -57,6 +61,8 @@ http://localhost:65432/debug/pprof/heap The profile will return almost instantly. +### Examine a profile using the Go toolchain + If you have Go installed and want to explore the profile, you can invoke `go tool pprof` to start the profile directly. The `-http=` parameter will instruct `go tool pprof` to start a web server providing a view of the captured profile: ``` @@ -72,6 +78,8 @@ You can then visit `http://localhost:23456` in your web browser to see a visual Also in the "View" menu, you can select "Flame Graph" to see a proportional interactive graph of the memory usage. +### Download a profile to send to someone else + If you don't have the Go tools installed but just want to capture the profile to send to someone else, you can instead use `curl` to download the profiler results: ```