-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 1009 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (27 loc) · 1009 Bytes
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
GO ?= go
.PHONY: help build test race lint experiment demo clean
help:
@echo "make test unit and integration tests, with the race detector"
@echo "make experiment the load sweep, the latency fault, the capacity swing"
@echo "make demo upstream + gateway + a burst of load, in one command"
build:
$(GO) build -o bin/ ./cmd/...
test:
$(GO) vet ./...
$(GO) test -race -count=1 ./...
race: test
lint:
gofmt -l . | tee /dev/stderr | (! read)
$(GO) vet ./...
experiment: build
./bin/ballast-bench -duration 5s -scenario 24s
demo: build
@./bin/ballast-upstream -workers 8 -fast 25ms -slow 120ms & echo $$! > /tmp/ballast-up.pid; \
sleep 1; \
./bin/ballast -upstream http://127.0.0.1:9101 -limiter gradient & echo $$! > /tmp/ballast-gw.pid; \
sleep 1; \
./bin/ballast-load -rate 2000 -duration 15s; \
echo; echo "--- gateway snapshot ---"; curl -s localhost:8081/snapshot; echo; \
kill `cat /tmp/ballast-gw.pid` `cat /tmp/ballast-up.pid` 2>/dev/null || true
clean:
rm -rf bin