2023-04-08 22:30:32 +02:00
|
|
|
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:
|
2023-04-10 11:43:13 +02:00
|
|
|
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
|
2023-04-10 13:01:19 +02:00
|
|
|
benchmark_server:
|
2023-04-10 19:49:43 +02:00
|
|
|
go test -gcflags "-m -m" -run none -bench . -benchtime 30s -benchmem -memprofile profile.out ./benchmark
|
2023-04-10 11:43:13 +02:00
|
|
|
benchmark_etl:
|
2023-04-10 14:52:05 +02:00
|
|
|
go test -gcflags "-m -m" -run none -bench . -benchtime 15s -benchmem -memprofile profile.out ./internal/etl/ > t.out
|
2023-04-10 11:43:13 +02:00
|
|
|
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
|
2023-04-10 19:49:43 +02:00
|
|
|
run_etl: build_etl
|
|
|
|
./etl
|
2023-04-08 22:30:32 +02:00
|
|
|
build_server:
|
2023-04-10 16:16:16 +02:00
|
|
|
env GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -o server ./cmd/server/main.go
|
2023-04-08 22:30:32 +02:00
|
|
|
run_server: build_server
|
2023-04-10 16:16:16 +02:00
|
|
|
./server
|
2023-04-10 19:49:43 +02:00
|
|
|
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
|