rest-api-prototype/Makefile

41 lines
960 B
Makefile
Raw Permalink Normal View History

2022-03-14 17:06:43 +01:00
.PHONY: run race build test bench-cpu bench-mem bench-trace bench-clean
2022-03-14 16:23:11 +01:00
run:
go run cmd/server/main.go
race:
go run --race cmd/server/main.go
build:
2022-04-23 21:11:04 +02:00
GOOS=linux GOARCH=amd64 go build -o build/server cmd/server/main.go
2022-03-14 16:23:11 +01:00
test:
go test -v -run=. test/**/*.go
bench: bench-clean
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile test/data/cpu.out -memprofile test/data/mem.out -trace test/data/trace.out ./test/handler/create_category_test.go | tee test/data/bench.log
bench-cpu:
go tool pprof -http :19800 test/data/cpu.out
bench-mem:
go tool pprof -http :19801 test/data/mem.out
bench-trace:
go tool trace test/data/trace.out
bench-clean:
rm -f test/data/*.out test/data/bench.log
2022-03-14 17:06:43 +01:00
clean:
rm -rf build
# run-profiler:
# go run cmd/server/main.go -cpuprofile cpu.prof -memprofile mem.prof
#
# profile-cpu-web:
# go tool pprof -http=127.0.0.1:9990 cpu.prof
#
# profile-mem-web:
# go tool pprof -http=127.0.0.1:9991 mem.prof