Skip to content

Commit

Permalink
Merge pull request #3 from madflojo/benchmarks
Browse files Browse the repository at this point in the history
Restructuring Benchmarks
  • Loading branch information
madflojo authored Jul 7, 2024
2 parents 3c6584c + 2147723 commit 7f8ac9f
Show file tree
Hide file tree
Showing 9 changed files with 616 additions and 264 deletions.
115 changes: 109 additions & 6 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
- actions
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cassandra:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -45,7 +50,23 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 120
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Cassandra" ./...
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 @@ -69,7 +90,23 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 60
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Redis" ./...
cd ./drivers/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 @@ -86,7 +123,23 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 60
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_KeyDB" ./...
cd ./drivers/redis
/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 @@ -108,7 +161,23 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 60
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_NATS" ./...
cd ./drivers/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 All @@ -120,7 +189,24 @@ jobs:
run: |
curl -L https://go.dev/dl/go1.22.0.linux-amd64.tar.gz | tar -C /usr/local -xzf -
- name: Execute Benchmarks
run: /usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Hashmap" ./...
run: |
cd ./drivers/hashmap
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Hashmap" ./... | tee output.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: hashmap-benchmark
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'go'
output-file-path: ./drivers/hashmap/output.txt
external-data-json-path: ./cache/hashmap-benchmark-data.json
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
summary-always: true

boltdb:
runs-on: ubuntu-latest
Expand All @@ -132,4 +218,21 @@ jobs:
run: |
curl -L https://go.dev/dl/go1.22.0.linux-amd64.tar.gz | tar -C /usr/local -xzf -
- name: Execute Benchmarks
run: /usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_BoltDB" ./...
run: |
cd ./drivers/bbolt
/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
156 changes: 0 additions & 156 deletions benchmarks/benchmark_test.go

This file was deleted.

33 changes: 0 additions & 33 deletions benchmarks/go.mod

This file was deleted.

Loading

0 comments on commit 7f8ac9f

Please sign in to comment.