-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 797 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.PHONY: build install test fmt start_backend stop_backend run push
WORKERS=100
REQUESTS_PER_WORKER=5
LOAD_REQUESTS=1000
LOAD_CONCURRENT_REQUESTS=5
build:
rm -rf .bin
mkdir .bin
cd .bin && go build ../src/github.com/ktraff/load_balancer/main.go
install:
go install src/github.com/ktraff/load_balancer/main.go
test:
go test ./...
fmt:
go fmt ./...
-git add .
-git commit -m "formatting"
start_backend:
cd backend && docker-compose up --detach --remove-orphans
stop_backend:
cd backend && docker-compose down
run: build
BACKEND_1=http://localhost:8000 \
BACKEND_2=http://localhost:8001 \
BACKEND_3=http://localhost:8002 \
./.bin/main $(WORKERS) $(REQUESTS_PER_WORKER)
push: fmt
git push
load_test:
ab -n $(LOAD_REQUESTS) -c $(LOAD_CONCURRENT_REQUESTS) http://localhost:8080/