44 lines
1.5 KiB
Makefile
44 lines
1.5 KiB
Makefile
COVERAGE_DIR=coverage
|
|
|
|
lint:
|
|
golangci-lint run ./...
|
|
goreportcard:
|
|
goreportcard-cli -v
|
|
test:
|
|
go test ./...
|
|
test-coverage:
|
|
rm -rf ${COVERAGE_DIR}
|
|
mkdir ${COVERAGE_DIR}
|
|
go test -v -coverprofile ${COVERAGE_DIR}/cover.out ./...
|
|
go tool cover -html ${COVERAGE_DIR}/cover.out -o ${COVERAGE_DIR}/cover.html
|
|
benchmark:
|
|
go test -run none -bench . -benchtime 3s -benchmem
|
|
benchmark_escape_analisys:
|
|
go test -gcflags "-m -m" -run none -bench . -benchtime 3s -benchmem -memprofile profile.out ./internal/etl
|
|
pprof:
|
|
go tool pprof -alloc_space profile.out
|
|
pprof_url:# top 40 -cum
|
|
go tool pprof -alloc_space http://localhost:5000/debug/pprof/allocs
|
|
benchmark_server:
|
|
go test -gcflags "-m -m" -run none -bench . -benchtime 30s -benchmem -memprofile profile.out ./benchmark
|
|
benchmark_etl:
|
|
go test -gcflags "-m -m" -run none -bench . -benchtime 15s -benchmem -memprofile profile.out ./internal/etl/ > t.out
|
|
trace_etl: build_etl# go tool trace t.out
|
|
$(build_etl)
|
|
time ./etl -trace > t.out
|
|
build_etl:
|
|
env GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -v -o etl ./cmd/etl/main.go
|
|
run_etl: build_etl
|
|
./etl
|
|
build_server:
|
|
env GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o server ./cmd/server/main.go
|
|
run_server: build_server
|
|
./server
|
|
benchmark_go_1000req:
|
|
go test -run TestGoRequests ./benchmark
|
|
benchmark_go_1000req_15s:
|
|
go test -run TestGoRequestsPerSecondFor15s ./benchmark
|
|
benchmark_nest_1000req:
|
|
go test -run TestNestRequests ./benchmark
|
|
benchmark_nest_1000req_15s:
|
|
go test -run TestNestRequestsPerSecondFor15s ./benchmark
|