-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
104 lines (68 loc) · 2.95 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
91
92
93
94
95
96
97
98
99
100
101
PACKAGE = dbperf
GOSRCS = $(wildcard *.go)
GODEPS = $(wildcard src/dbperf/*.go) \
$(wildcard src/dbtest/*.go) \
$(wildcard src/dbdriver/*.go) \
$(GOSRCS)
#--------------------------------------------------
all: build
@echo "Usage: make read|write-innodb|myisam|postgres. Eg make write-myisam"
ifeq ($(PGXDB),)
PGXDB = "postgres://testuser:12345@localhost/testdb?sslmode=disable"
endif
ifeq ($(MYSQLDB),)
MYSQLDB = "testuser:12345@/testdb"
endif
ifeq ($(CLKDB),)
CLKDB = "http://testuser:12345@tcp(127.0.0.1:9000)/testdb"
endif
ifeq ($(DURATION),)
DURATION = 60
endif
ifeq ($(TABLE),)
#Possible choices: slim, light, light-with-index, large
TABLE = "light"
endif
#--------------------------------------------------
build: bin/$(PACKAGE)
bin/$(PACKAGE): $(GODEPS)
go fmt ./...
go build -o bin/$(PACKAGE) main.go
@mkdir -p reports results
#--------------------------------------------------
run-all: build run-write run-read
#-------------------------------------------------- WRITE
run-write:
make perform-all-engines MODE=write DURATION=$(DURATION) TABLE=light
make perform-all-engines MODE=write DURATION=$(DURATION) TABLE=light-with-index
make perform-all-engines MODE=write DURATION=$(DURATION) TABLE=large
#-------------------------------------------------- READ
run-read:
make perform-all-engines MODE=read DURATION=$(DURATION) TABLE=light
make perform-all-engines MODE=read DURATION=$(DURATION) TABLE=light-with-index
make perform-all-engines MODE=read DURATION=$(DURATION) TABLE=large
#--------------------------------------------------
perform-all-engines:
bin/dbperf --mode $(MODE) --engine MyISAM --db $(MYSQLDB) --duration $(DURATION) --table $(TABLE)
bin/dbperf --mode $(MODE) --engine InnoDB --db $(MYSQLDB) --duration $(DURATION) --table $(TABLE)
bin/dbperf --mode $(MODE) --engine postgres --db $(PGXDB) --duration $(DURATION) --table $(TABLE)
#--------------------------------------------------
cleandb: build
bin/dbperf --clean --db $(MYSQLDB) --engine InnoDB
bin/dbperf --clean --db $(MYSQLDB) --engine MyISAM
bin/dbperf --clean --db $(PGXDB) --engine postgres
#--------------------------------------------------
write-clickhouse: build
bin/dbperf --mode write --engine clickhouse --db $(CLKDB) --duration $(DURATION) --table $(TABLE)
write-postgres: build
bin/dbperf --mode write --engine postgres --db $(PGXDB) --duration $(DURATION) --table $(TABLE)
read-postgres: build
bin/dbperf --mode read --engine postgres --db $(PGXDB) --duration $(DURATION) --table $(TABLE)
write-innodb: build
bin/dbperf --mode write --engine InnoDB --db $(MYSQLDB) --duration $(DURATION) --table $(TABLE)
read-innodb: build
bin/dbperf --mode read --engine InnoDB --db $(MYSQLDB) --duration $(DURATION) --table $(TABLE)
write-myisam: build
bin/dbperf --mode write --engine MyISAM --db $(MYSQLDB) --duration $(DURATION) --table $(TABLE)
read-myisam: build
bin/dbperf --mode read --engine MyISAM --db $(MYSQLDB) --duration $(DURATION) --table $(TABLE)