BUILD: add pprof

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2021-09-01 13:24:53 -05:00
parent 3556a4d54c
commit 9105a180c6
3 changed files with 7 additions and 0 deletions

1
.gitignore vendored
View File

@ -14,6 +14,7 @@ example-gocui-active/example-gocui-active
example-gocui-colorstrue/example-gocui-colorstrue example-gocui-colorstrue/example-gocui-colorstrue
example-gocui-dynamic/example-gocui-dynamic example-gocui-dynamic/example-gocui-dynamic
example-gocui-mouse/example-gocui-mouse example-gocui-mouse/example-gocui-mouse
example-pprof/example-pprof
example-shell/example-shell example-shell/example-shell
example-systray/example-systray example-systray/example-systray
example-ui-controlgallery/example-ui-controlgallery example-ui-controlgallery/example-ui-controlgallery

View File

@ -24,6 +24,9 @@ build:
cd example-ui-radiobutton; go install # slidebars, lists, radio buttons cd example-ui-radiobutton; go install # slidebars, lists, radio buttons
cd example-ui-table; go install # spreadsheet cd example-ui-table; go install # spreadsheet
# golang things
cd example-pprof; go install # dump out go process internals
debug: debug:
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}" go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}"

View File

@ -73,6 +73,9 @@ func main() {
http.HandleFunc("/block", func(rw http.ResponseWriter, req *http.Request) { http.HandleFunc("/block", func(rw http.ResponseWriter, req *http.Request) {
usesAResource() usesAResource()
}) })
log.Println("run this and then hit:")
log.Println("http://localhost:6060/debug/pprof/")
log.Println("")
log.Println("Running!") log.Println("Running!")
log.Println(http.ListenAndServe("localhost:6060", nil)) log.Println(http.ListenAndServe("localhost:6060", nil))
} }