-
Notifications
You must be signed in to change notification settings - Fork 4
83 lines (69 loc) · 2.3 KB
/
bench.yml
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
name: 'Benchmark'
on:
push:
branches: [main]
workflow_dispatch:
pull_request:
env:
REGISTRY: ghcr.io
WORKDIR: dev/local/ch-bench-read
COMPOSE_FILE: docker-compose.ci.yml
OTEL_EXPORTER_OTLP_INSECURE: "true"
jobs:
PromQL:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.21.x"
cache: false
- uses: docker/setup-buildx-action@v3
- name: Docker log in
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Get Go environment
id: go-env
run: |
echo "cache=$(go env GOCACHE)" >> $GITHUB_ENV
echo "modcache=$(go env GOMODCACHE)" >> $GITHUB_ENV
echo "goversion=$(go env GOVERSION)" >> $GITHUB_ENV
- name: Set up cache
uses: actions/cache@v3
with:
path: |
${{ env.cache }}
${{ env.modcache }}
key: Benchmark-${{ runner.os }}-go-${{ env.goversion }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
Benchmark-${{ runner.os }}-go-${{ env.goversion }}
- name: Go build
env:
CGO_ENABLED: 0
run: |
go build -v ./cmd/oteldb
go build -v ./cmd/chotel
- name: Start
working-directory: ${{ env.WORKDIR }}
run: docker compose up -d
- name: Load data
run: |
wget https://storage.yandexcloud.net/faster-public/oteldb/req.rwq
go run github.com/go-faster/oteldb/cmd/otelbench promrw replay -i req.rwq
- name: Test
working-directory: ${{ env.WORKDIR }}
run: go run github.com/go-faster/oteldb/cmd/otelbench promql bench -o report.yml -i testdata/node-exporter-selected.promql.yml --trace --allow-empty=false --warmup 5
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: report.yml
path: ${{ env.WORKDIR }}/report.yml
if-no-files-found: error
retention-days: 1
- name: Analyze report
working-directory: ${{ env.WORKDIR }}
run: go run github.com/go-faster/oteldb/cmd/otelbench promql analyze -i report.yml