-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
91 lines (65 loc) · 1.88 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
GOBIN=$(shell which go)
ARCH?=
BUILD_CMD = GOARCH=${ARCH} ${GOBIN} build
INSTALL_CMD = GOARCH=${ARCH} ${GOBIN} install
BINDIR = ./bin
GOBINDIR = `readlink -f ./bin`
PROFILE = -tags profile
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
LDFLAGS=-all-static
GO_FLAGS=--ldflags '-extldflags "-static"'
all: sybil
demo:
GOBIN=$(GOBINDIR) $(BUILD_CMD) $(GO_FLAGS) $(BUILD_FLAGS) ./src/api/demo
deps:
${GOBIN} get -d -v -t ./...
sybil: bindir
GOBIN=$(GOBINDIR) $(BUILD_CMD) $(GO_FLAGS) $(BUILD_FLAGS) ./
GOBIN=$(GOBINDIR) $(INSTALL_CMD) $(GO_FLAGS) $(BUILD_FLAGS) ./
fake-data: fake-uptime
fake-people:
python scripts/fakedata/people_generator.py 50000 | ./bin/sybil ingest -table people
./bin/sybil digest -table people
fake-uptime:
python scripts/fakedata/host_generator.py 1000000 | ./bin/sybil ingest -table uptime
./bin/sybil digest -table uptime
testquery:
${BINDIR}/sybil query -table people -int age,f1 -op hist -group state
bindir:
mkdir ${BINDIR} 2>/dev/null || true
test:
${GOBIN} test ./src/lib/ -race -v
testv:
${GOBIN} test ./src/lib/ -race -v -debug
test-api: sybil
${GOBIN} test ./src/api/ -race -v
testv-api: sybil
${GOBIN} test ./src/api/ -race -v -debug
update-golden:
${GOBIN} test ./src/lib --update-golden
coverage:
${GOBIN} test -covermode atomic -coverprofile cover.out ./src/lib
sed -i "s|_${ROOT_DIR}|.|" cover.out
${GOBIN} tool cover -html=cover.out -o cover.html
benchmarks:
${GOBIN} test -run=NONE -benchmem -bench=. ./src/lib |tee bench.txt
tdigest: export BUILD_FLAGS += -tags tdigest
tdigest: bindir
make all
nodeltaencoding: export BUILD_FLAGS += -tags denc
nodeltaencoding: bindir
make all
profile: export BUILD_FLAGS += -tags profile
profile: bindir
make all
tags:
ctags --languages=+Go src/lib/*.go
starscope -e cscope
starscope -e ctags
default: all
clean:
rm ./bin/*
.PHONY: tags
.PHONY: query
.PHONY: ingest
.PHONY: clean