-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github action to run serverless benchmarks.
- Loading branch information
1 parent
d12ee08
commit 2d1d22e
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: "Serverless Benchmarks" | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'cmd/serverless/**' | ||
- 'pkg/serverless/**' | ||
- 'test/integration/serverless/**' | ||
- '.github/workflows/serverless-integration.yml' | ||
|
||
env: | ||
DD_API_KEY: must-be-set | ||
|
||
jobs: | ||
comment: | ||
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=10 -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=10 -benchtime=10x -timeout=60m \ | ||
./pkg/serverless/... | tee current.txt | ||
- name: Analyze results | ||
id: analyze | ||
run: | | ||
go install golang.org/x/perf/cmd/benchstat@latest | ||
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 }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters