Added config option to enable pprof (#253)

* Added config option to enable pprof

* fixed typo in Makefile
This commit is contained in:
Andrew
2019-03-14 14:56:30 +11:00
committed by Adrian Gallagher
parent 6cb356cd7a
commit 58bd0a301b
5 changed files with 30 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ LDFLAGS = -ldflags "-w -s"
GCTPKG = github.com/thrasher-/gocryptotrader
LINTPKG = github.com/golangci/golangci-lint/cmd/golangci-lint@v1.15.0
LINTBIN = $(GOPATH)/bin/golangci-lint
GCTLISTENPORT=9050
GCTPROFILERLISTENPORT=8085
get:
GO111MODULE=on go get $(GCTPKG)
@@ -29,4 +31,12 @@ update_deps:
GO111MODULE=on go mod verify
GO111MODULE=on go mod tidy
rm -rf vendor
GO111MODULE=on go mod vendor
GO111MODULE=on go mod vendor
.PHONY: profile_heap
profile_heap:
go tool pprof -http "localhost:$(GCTPROFILERLISTENPORT)" 'http://localhost:$(GCTLISTENPORT)/debug/pprof/heap'
.PHONY: profile_cpu
profile_cpu:
go tool pprof -http "localhost:$(GCTPROFILERLISTENPORT)" 'http://localhost:$(GCTLISTENPORT)/debug/pprof/profile'