-
Notifications
You must be signed in to change notification settings - Fork 34
67 lines (56 loc) · 2.09 KB
/
lavinmqperf.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
name: lavinmqperf benchmark
on:
pull_request:
branches:
- main
jobs:
spec:
name: benchmark
runs-on: ubuntu-latest
container: 84codes/crystal:latest-ubuntu-20.04
steps:
- name: Print Crystal version
run: crystal -v
- name: Install dependencies
run: apt-get update && apt-get install -y liblz4-dev
- name: Checkout
uses: actions/checkout@v4
with:
path: 'pr'
- name: Build lavinmq
run: cd pr && make -j bin/lavinmq bin/lavinmqperf DOCS=
- name: Perf
run: cd pr && chmod u+x extras/action_benchmark.sh && ./extras/action_benchmark.sh /tmp/pr.log
- name: Checkout main
uses: actions/checkout@v4
with:
path: 'main'
ref: 'main'
- name: Build lavinmq
run: cd main && make -j bin/lavinmq bin/lavinmqperf DOCS=
- name: Perf
run: cp pr/extras/action_benchmark.sh main/extras/action_benchmark.sh && cd main && ./extras/action_benchmark.sh /tmp/main.log
- name: Compare
run: |
PR_LOG_CONTENTS=$(cat /tmp/pr.log)
MAIN_LOG_CONTENTS=$(cat /tmp/main.log)
PR_PUBLISH=$(tail -n 2 /tmp/pr.log | head -n 1)
PR_CONSUME=$(tail -n 1 /tmp/pr.log)
MAIN_PUBLISH=$(tail -n 2 /tmp/main.log | head -n 1)
MAIN_CONSUME=$(tail -n 1 /tmp/main.log)
echo "PR_PUBLISH='$PR_PUBLISH'" >> $GITHUB_ENV
echo "PR_CONSUME='$PR_CONSUME'" >> $GITHUB_ENV
echo "MAIN_PUBLISH='$MAIN_PUBLISH'" >> $GITHUB_ENV
echo "MAIN_CONSUME='$MAIN_CONSUME'" >> $GITHUB_ENV
- name: comment
uses: mshick/add-pr-comment@v2
with:
message: |
**Main benchmark**
${{ env.MAIN_PUBLISH }}
${{ env.MAIN_CONSUME }}
**PR benchmark**
${{ env.PR_PUBLISH }}
${{ env.PR_CONSUME }}
_Keep in mind, these numbers are not representative of LavinMQ's peak performance.
It is rather an indication of how the changes of this pull request affects the performance of the main branch._