Skip to content

Commit d37e917

Browse files
Add benchmark workflow (#153)
*Issue #, if available:* *Description of changes:* This PR builds off of PR #122 and creates a benchmark workflow similar to integration tests workflow that runs the benchmarks added in PR #122 Add two basic benchmarks - One that performs cache hit retrievals - One that intentionally yields cache misses on every retrieval Using [criterion](https://docs.rs/criterion/latest/criterion/) (used by the AWS SDK for Rust). This hopefully will serve to catch performance regressions in future code changes and open the door to profiling. Successful run from fork: https://github.com/reyhankoyun/aws-secretsmanager-agent/actions/runs/20082405961/job/57612354790 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Simon Marty <simon.marty@protonmail.com> Co-authored-by: Simon <simon.marty0@gmail.com> Co-authored-by: Simon Marty <martysi@amazon.com> Co-authored-by: Simon Marty <simon.marty@protonmail.com>
1 parent 7c6a7bc commit d37e917

File tree

5 files changed

+860
-580
lines changed

5 files changed

+860
-580
lines changed

.github/workflows/benchmarks.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Benchmarks
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
benchmark:
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v5
23+
24+
- name: Install Rust stable
25+
uses: actions-rs/toolchain@v1
26+
with:
27+
toolchain: stable
28+
override: true
29+
30+
- name: Run benchmarks
31+
working-directory: aws_secretsmanager_caching
32+
run: cargo bench --bench benchmark
33+
34+
- name: Upload benchmark results
35+
if: always()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: benchmark-results-${{ github.sha }}
39+
path: target/criterion/
40+
if-no-files-found: error
41+
retention-days: 30

0 commit comments

Comments
 (0)