-
Notifications
You must be signed in to change notification settings - Fork 207
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 vault perf test and publish results to datadog
- Loading branch information
Showing
2 changed files
with
88 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,52 @@ | ||
name: Publish Datadog Metric | ||
description: GitHub Action to publish a metric to DD. | ||
|
||
inputs: | ||
datadog-token: | ||
description: 'secret datadog API token' | ||
required: true | ||
metric: | ||
description: 'metric name for datadog' | ||
required: true | ||
metric-value: | ||
description: 'metric value for datadog' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Publish Given Metric to Datadog using API. | ||
shell: bash | ||
id: publish_metric | ||
env: | ||
DATADOG_API_KEY: ${{ inputs.datadog-token }} | ||
VALUE: ${{ inputs.metric-value }} | ||
METRIC: ${{ inputs.metric }} | ||
run: | | ||
export NOW="$(date +%s)" | ||
curl -v POST "https://api.us3.datadoghq.com/api/v1/series" \ | ||
-H "Content-Type: application/json" \ | ||
-H "DD-API-KEY: $DATADOG_API_KEY" \ | ||
-d @- << EOF | ||
{ | ||
"series": [{ | ||
"metric": "ci.${METRIC}", | ||
"points": [ | ||
[ | ||
$NOW, | ||
$VALUE | ||
] | ||
], | ||
"tags": [ | ||
"os:${{ runner.os }}", | ||
"arch:${{ runner.arch }}", | ||
"repo:${{ github.repository }}", | ||
"job:${{ github.job }}", | ||
"workflow:${{ github.workflow }}", | ||
"source:Github Actions", | ||
"branch:${GITHUB_REF##*/}" | ||
], | ||
"type": "gauge" | ||
}] | ||
} | ||
EOF |
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,36 @@ | ||
name: Run Benchmarks | ||
|
||
# run on changes to trunk, and also nightly | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
schedule: | ||
# Run an hour after the daily test-all-packages.yml job, so it can | ||
# populate the build caches | ||
- cron: '47 6 * * *' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/restore-node | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: yarn bench (vats) | ||
shell: bash | ||
run: | | ||
cd packages/vats && yarn bench | ||
echo "METRIC_VALUE=`cat benchmark-stress-vaults.json | jq .avgPerVaultMs`" >> $GITHUB_ENV | ||
- uses: ./.github/actions/publish-metric | ||
with: | ||
metric: 'vats.perf.avgPerVaultMs' | ||
metric-value: ${{env.METRIC_VALUE}} | ||
datadog-token: ${{ secrets.DATADOG_API_KEY }} |