-
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 454a124
Showing
2 changed files
with
79 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,78 @@ | ||
name: "Serverless Benchmarks" | ||
|
||
on: | ||
push: | ||
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: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: stable | ||
|
||
- name: Install benchstat | ||
run: | | ||
go install golang.org/x/perf/cmd/benchstat@latest | ||
benchstat | ||
- 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 | ||
benchstat -row /event previous.txt 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