-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (31 loc) · 2.18 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
AUTO_BUILD_VERSION ?= dev
GOPATH := $(shell go env GOPATH)
.PHONY: build
build: BUILD/slog-agent
include ${GOPATH}/opt/gotils/Common.mk
BUILD/slog-agent: Makefile go.mod $(SOURCES_NONTEST)
GO_LDFLAGS="-X main.version=$(AUTO_BUILD_VERSION)" ./build.sh -o $@
.PHONY: test-gen
test-gen: BUILD/slog-agent
LOG_LEVEL=$${LOG_LEVEL:-warn} LOG_COLOR=$${LOG_COLOR:-Y} go test -timeout $${TEST_TIMEOUT:-10s} -v ./... -args gen
# Run all micro benchmarks
.PHONY: bench-micro
bench-micro: BUILD/slog-agent
LOG_LEVEL=$${LOG_LEVEL:-warn} LOG_COLOR=$${LOG_COLOR:-Y} go test -run="^$$" -bench=. -benchmem ./...
# TODO: integrate benchmarks to CI
# Main benchmarks under different GOMAXPROCS, to check the cost of concurrent executions, that high GOMAXPROCS doesn't increase overall CPU time by much
.PHONY: bench-cpus
bench-cpus: BUILD/slog-agent
# PIPELINE, 1 THREAD
GOMAXPROCS=1 LOG_LEVEL=warn time BUILD/slog-agent --trace /tmp/pipeline-config-cpu-1.trace benchmark pipeline --input 'testdata/development/*-input.log' --repeat 100000 --config testdata/config_sample.yml
# AGENT, 1 THREAD
GOMAXPROCS=1 LOG_LEVEL=warn time BUILD/slog-agent --trace /tmp/agent-config-cpu-1.trace benchmark agent --input 'testdata/development/*-input.log' --repeat 100000 --config testdata/config_sample.yml
# AGENT, cpuNum THREADs
GOMAXPROCS= LOG_LEVEL=warn time BUILD/slog-agent --trace /tmp/agent-config-cpu-n.trace benchmark agent --input 'testdata/development/*-input.log' --repeat 100000 --config testdata/config_sample.yml
# AGENT, 100 THREADs
GOMAXPROCS=100 LOG_LEVEL=warn time BUILD/slog-agent --trace /tmp/agent-config-cpu-100.trace benchmark agent --input 'testdata/development/*-input.log' --repeat 100000 --config testdata/config_sample.yml
# Main benchmarks for different pipelines and agent types
.PHONY: bench-full
bench-full: BUILD/slog-agent
LOG_LEVEL=warn time BUILD/slog-agent --cpuprofile /tmp/pipeline-config-cpu.profile benchmark pipeline --input 'testdata/development/*-input.log' --repeat 100000 --config testdata/config_sample.yml
LOG_LEVEL=warn time BUILD/slog-agent --cpuprofile /tmp/agent-config-cpu.profile benchmark agent --input 'testdata/development/*-input.log' --repeat 100000 --config testdata/config_sample.yml