diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 0f77f669f6..3631878189 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -12,6 +12,15 @@ permissions: deployments: write jobs: + commit-metadata: + runs-on: ubuntu + steps: + - uses: actions/checkout@v4 + - name: Upload Commit Metadata + shell: bash + run: | + sudo apt-get update && sudo apt-get install -y jq + bash scripts/cat-s3.sh vortex-bench-dev commits.json <(bash scripts/commit-json.sh) bench: strategy: matrix: diff --git a/scripts/coerce-criterion-json.sh b/scripts/coerce-criterion-json.sh new file mode 100644 index 0000000000..1f5624babe --- /dev/null +++ b/scripts/coerce-criterion-json.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +commit_id=$(git rev-parse HEAD) + +jq --compact-output 'select(.reason == "benchmark-complete" or .reason == null) + | if (.throughput | length) == 0 + then ([{ + name: (.name // .id), + unit: .unit, + value: (.value // .mean.estimate), + commit_id: "'$commit_id'" + }]) + else ([{ + name: .id, + unit: .unit, + value: .mean.estimate, + commit_id: "'$commit_id'" + }, { + name: (.id + "throughput"), + unit: (.throughput[0].unit + "/" + .unit), + value: (.throughput[0].per_iteration / .mean.estimate), + time: .mean.estimate, + bytes: .throughput[0].per_iteration, + commit_id: "'$commit_id'" + }]) + end + | .[] +' diff --git a/scripts/commit-json.sh b/scripts/commit-json.sh index 6b7105254b..d09423a6b3 100644 --- a/scripts/commit-json.sh +++ b/scripts/commit-json.sh @@ -12,7 +12,7 @@ commit_timestamp=$(git log -1 --format=%cd --date=iso-strict) tree_id=$(git rev-parse --verify HEAD^{tree}) repo_url=$(git config --get remote.origin.url | sed 's/git@github.com:/https:\/\/github.com\//' | sed 's/.git$//') # Convert to HTTPS format -jq -c '.' > commit.json <