Skip to content

Commit

Permalink
Adding Benchmark Summaries for all Jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
madflojo committed Jul 7, 2024
1 parent d740cda commit 2147723
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 5 deletions.
83 changes: 79 additions & 4 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ jobs:
sleep 120
cd ./drivers/cassandra
/usr/local/go/bin/go test -run=Benchmark -bench ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: cassandra-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ./drivers/cassandra/output.txt
external-data-json-path: ./cache/cassandra-benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true

redis:
runs-on: ubuntu-latest
Expand All @@ -76,7 +91,22 @@ jobs:
run: |
sleep 60
cd ./drivers/redis
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Redis" ./...
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Redis" ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: redis-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ./drivers/redis/output.txt
external-data-json-path: ./cache/redis-benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true

keydb:
runs-on: ubuntu-latest
Expand All @@ -94,7 +124,22 @@ jobs:
run: |
sleep 60
cd ./drivers/redis
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_KeyDB" ./...
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_KeyDB" ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: keydb-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ./drivers/redis/output.txt
external-data-json-path: ./cache/keydb-benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true

nats:
runs-on: ubuntu-latest
Expand All @@ -117,7 +162,22 @@ jobs:
run: |
sleep 60
cd ./drivers/nats
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_NATS" ./...
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_NATS" ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: nats-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ./drivers/nats/output.txt
external-data-json-path: ./cache/nats-benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true

hashmap:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -160,4 +220,19 @@ jobs:
- name: Execute Benchmarks
run: |
cd ./drivers/bbolt
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_BoltDB" ./...
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_BoltDB" ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: boltdb-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ./drivers/bbolt/output.txt
external-data-json-path: ./cache/boltdb-benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true
2 changes: 1 addition & 1 deletion drivers/bbolt/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func BenchmarkDrivers(b *testing.B) {
}
`)

b.Run("Bench_BBolt", func(b *testing.B) {
b.Run("Bench_BoltDB", func(b *testing.B) {
var db hord.Database
var err error
db, err = Dial(Config{
Expand Down

0 comments on commit 2147723

Please sign in to comment.