-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (23 loc) · 879 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
all:
go build
install:
go install
test:
go test -test.v -cover -race
go test -run=xxx -test.bench=. -test.benchmem
@# Recreate a profile_cpu.out without race cover and bench, which skew results
go test -cpuprofile profile_cpu.out
# The following requires graphviz
viz:
go tool pprof -svg profile_cpu.out > profile_cpu.svg
# The following requires github.com/uber/go-torch and github.com/brendangregg/FlameGraph
# Here it is installed to $(HOME)/software/FlameGraph
# NOTE: go tool now supports this directly so use that instead! Uninstall the software: learn how to use pprof
torch:
PATH=$(PATH):$(HOME)/software/FlameGraph go-torch -b profile_cpu.out -f profile_cpu.torch.svg
heap:
go build -gcflags '-m -m -l -e'
@# two more m's are possible but its too verbose
@# -race is better for load and integration tests
lint:
golangci-lint run --skip-dirs 'scrap'