Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructuring Benchmarks #3

Merged
merged 3 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 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,8 @@ 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
madflojo marked this conversation as resolved.
Show resolved Hide resolved

redis:
runs-on: ubuntu-latest
Expand All @@ -69,6 +75,7 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 60
cd ./drivers/redis
madflojo marked this conversation as resolved.
Show resolved Hide resolved
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_Redis" ./...

keydb:
Expand All @@ -86,6 +93,7 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 60
cd ./drivers/redis
madflojo marked this conversation as resolved.
Show resolved Hide resolved
/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_KeyDB" ./...

nats:
Expand All @@ -108,6 +116,7 @@ jobs:
- name: Execute Benchmarks
run: |
sleep 60
cd ./drivers/nats
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a verification step.

Add a step to verify the NATS service is running before executing benchmarks.

- name: Verify NATS Service
  run: |
    until nc -z localhost 8222; do echo "Waiting for NATS to start..."; sleep 5; done

/usr/local/go/bin/go test -run=Benchmark -bench "BenchmarkDrivers/Bench_NATS" ./...

hashmap:
Expand All @@ -120,7 +129,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a verification step.

Add a step to verify the benchmark results before storing them.

- name: Verify Benchmark Results
  run: |
    if grep -q "FAIL" output.txt; then exit 1; fi

- 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 +158,6 @@ 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" ./...
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.

69 changes: 0 additions & 69 deletions benchmarks/go.sum

This file was deleted.

Loading
Loading