From 9105a180c64ea4fae64c5316ceadbe69ed71fa86 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 1 Sep 2021 13:24:53 -0500 Subject: [PATCH] BUILD: add pprof Signed-off-by: Jeff Carr --- .gitignore | 1 + Makefile | 3 +++ example-pprof/main.go | 3 +++ 3 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index c31c4fb..1f10cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ example-gocui-active/example-gocui-active example-gocui-colorstrue/example-gocui-colorstrue example-gocui-dynamic/example-gocui-dynamic example-gocui-mouse/example-gocui-mouse +example-pprof/example-pprof example-shell/example-shell example-systray/example-systray example-ui-controlgallery/example-ui-controlgallery diff --git a/Makefile b/Makefile index 1b72036..9e2769e 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ build: cd example-ui-radiobutton; go install # slidebars, lists, radio buttons cd example-ui-table; go install # spreadsheet + # golang things + cd example-pprof; go install # dump out go process internals + debug: go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}" diff --git a/example-pprof/main.go b/example-pprof/main.go index 6051db6..0d72735 100644 --- a/example-pprof/main.go +++ b/example-pprof/main.go @@ -73,6 +73,9 @@ func main() { http.HandleFunc("/block", func(rw http.ResponseWriter, req *http.Request) { usesAResource() }) + log.Println("run this and then hit:") + log.Println("http://localhost:6060/debug/pprof/") + log.Println("") log.Println("Running!") log.Println(http.ListenAndServe("localhost:6060", nil)) }