updated makefile targets for profiling

This commit is contained in:
Philipp Mieden 2019-05-21 12:11:54 +02:00
parent 3985784579
commit 63640b24b2
2 changed files with 26 additions and 7 deletions

4
.gitignore vendored
View File

@ -1,5 +1,5 @@
http.test
cprof
*.test
cprof-*
var
.*
*~

View File

@ -24,8 +24,8 @@ build-docker: clean build-arch
package: build
pkg/build.sh
test:
go test ./...
# docker
docker-build:
docker build -t $(IMAGE):$(TAG) .
@ -33,6 +33,25 @@ docker-build:
docker-push:
docker push $(IMAGE):$(TAG)
profile-test:
go test -run=none -bench=ClientServerParallel4 -cpuprofile=cprof net/http
go tool pprof --text http.test cprof
# testing / benchmarks
test:
go test ./...
bench:
go test -run=none -bench=. ./...
# profiling
test-cpu-profile:
go test -cpuprofile=cprof-client github.com/foomo/contentserver/client
go tool pprof --text client.test cprof-client
go test -cpuprofile=cprof-repo github.com/foomo/contentserver/repo
go tool pprof --text repo.test cprof-repo
test-gctrace:
GODEBUG=gctrace=1 go test ./...
test-malloctrace:
GODEBUG=allocfreetrace=1 go test ./...