-
Notifications
You must be signed in to change notification settings - Fork 1.2k
69 lines (59 loc) · 2.15 KB
/
serverless-benchmarks.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
name: "Serverless Benchmarks"
on:
pull_request:
paths:
- 'cmd/serverless/**'
- 'pkg/serverless/**'
- '.github/workflows/serverless-benchmarks.yml'
env:
DD_API_KEY: must-be-set
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout datadog-agent repository
uses: actions/checkout@v3
with:
path: go/src/github.com/DataDog/datadog-agent
- name: Checkout datadog-agent base branch
run: |
cd go/src/github.com/DataDog/datadog-agent
git fetch origin $GITHUB_BASE_REF --depth 1
git checkout $GITHUB_BASE_REF
- name: Previous benchmark results
run: |
cd go/src/github.com/DataDog/datadog-agent
go test -tags=test -run='^$' -bench=StartEndInvocation -count=4 -benchtime=10x -timeout=60m \
./pkg/serverless/... | tee previous.txt
- name: Checkout datadog-agent pr branch
run: |
cd go/src/github.com/DataDog/datadog-agent
git fetch origin $GITHUB_SHA --depth 1
git checkout $GITHUB_SHA
- name: Current benchmark results
run: |
cd go/src/github.com/DataDog/datadog-agent
go test -tags=test -run='^$' -bench=StartEndInvocation -count=4 -benchtime=10x -timeout=60m \
./pkg/serverless/... | tee current.txt
- name: Analyze results
id: analyze
run: |
cd go/src/github.com/DataDog/datadog-agent
go get golang.org/x/perf/cmd/benchstat@latest
go install golang.org/x/perf/cmd/benchstat@latest
cd -
benchstat -row /event \
go/src/github.com/DataDog/datadog-agent/previous.txt \
go/src/github.com/DataDog/datadog-agent/current.txt | tee output.txt
OUTPUT=$(cat output.txt)
echo "analyze=$OUTPUT" >> $GITHUB_OUTPUT
- name: Post comment
uses: marocchino/[email protected]
with:
hide_and_recreate: true
hide_classify: "RESOLVED"
message: |
\#\# Serverless Benchmark Results
```
${{ steps.analyze.outputs.analyze }}
```