-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmakefile
More file actions
70 lines (54 loc) · 1.78 KB
/
makefile
File metadata and controls
70 lines (54 loc) · 1.78 KB
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
GO=$(shell which go)
BENCH_COUNT ?= 6
CI_BENCHMARKS=STEF\|/STEF
MASTER_BRANCH ?= main
REF_NAME ?= $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
SHELL := /bin/bash
VERSION=1.1
BENCHSTAT=$(shell which benchstat)
.PHONY: default
default: build test
.PHONY: all
all: build test benchmark
.PHONY: build
build:
go build -o bin/stefstats cmd/stats/main.go
go build -o bin/stefbench cmd/stefbench/main.go
go build -o bin/otlp2stef cmd/otlp2stef/main.go
.PHONY: testcompat
testcompat: # Test compatibility of current implementation with old format files
# Generate old test files
cd scripts && ./genoldtestfiles.sh
# Run compatibility tests
go test -v -run TestCopy
# Restore/generate current test files
cd scripts && ./gentestfiles.sh
.PHONY: gentestfiles
gentestfiles:
cd scripts && ./gentestfiles.sh
.PHONY: test
test: gentestfiles
go test -v ./...
benchmark: gentestfiles
go test ./... -run notest -bench . -benchtime 100ms
.PHONY: build-ci
build-ci:
make testcompat
make all
.PHONY: benchmark-ci
benchmark-ci: gentestfiles bench-run bench-stat-diff bench-stat
.PHONY: bench-stat-cli
bench-stat-cli:
@test -s $(GOPATH)/bin/benchstat || sudo GOFLAGS= GOBIN=$(GOPATH)/bin $(GO) install golang.org/x/perf/cmd/benchstat@latest
.PHONY: bench-run
bench-run:
@set -o pipefail && $(GO) test -test.benchmem -bench=$(CI_BENCHMARKS) -count=$(BENCH_COUNT) -run=^a ./... | tee bench-$(REF_NAME).txt
.PHONY: bench-stat-diff
bench-stat-diff: bench-stat-cli
@test ! -e bench-$(MASTER_BRANCH).txt || benchstat bench-$(MASTER_BRANCH).txt bench-$(REF_NAME).txt
.PHONY: bench-stat
bench-stat: bench-stat-cli
benchstat bench-$(REF_NAME).txt
.PHONY: update-charts
update-charts:
UPDATE_BENCH_HTML=1 go test -run TestMetricsSize\|Multipart -bench \(alizeNative\|Pdata\) -benchtime=5s