Skip to content

Commit

Permalink
Setting up benchmark result persistance
Browse files Browse the repository at this point in the history
  • Loading branch information
marco6 committed Jun 7, 2024
1 parent 126d8fd commit 9988384
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
41 changes: 40 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,30 @@ jobs:
run: go mod download

- name: Run benchmarks
run: make go.bench
run: make go.bench | tee output.txt

- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./benchmarks
key: ${{ runner.os }}-benchmark

- name: Store benchmarks result
uses: benchmark-action/github-action-benchmark@v1.20.3
with:
name: SQLite
tool: 'go'
output-file-path: output.txt
external-data-json-path: ./benchmarks/data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: "benchmarks"
alert-threshold: "150%"
summary-always: true
comment-always: true
fail-on-alert: true
fail-threshold: "400%"


benchmarks-dqlite:
name: Benchmark dqlite
Expand All @@ -114,6 +137,22 @@ jobs:
- name: Run benchmarks
run: make go.bench.dqlite

- name: Store benchmarks result
uses: benchmark-action/github-action-benchmark@v1.20.3
with:
name: dqlite
tool: 'go'
output-file-path: output.txt
external-data-json-path: ./benchmarks/data.json
github-token: ${{ secrets.GITHUB_TOKEN }}
gh-pages-branch: gh-pages
benchmark-data-dir-path: "benchmarks"
alert-threshold: "150%"
summary-always: true
comment-always: true
fail-on-alert: true
fail-threshold: "400%"

build:
name: Build k8s-dqlite
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions test/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ import (
clientv3 "go.etcd.io/etcd/client/v3"
)

func Fib(u uint) uint {
if u <= 1 {
return 1
}
return Fib(u-2) + Fib(u-1)
}
func BenchmarkFib20WithAuxMetric(b *testing.B) {
for i := 0; i < b.N; i++ {
var _ = Fib(20)
}
b.ReportMetric(4.0, "auxMetricUnits")
}

// TestAdmissionControl puts heavy load on kine and expects that some requests are denied
// by the admission control.
func TestAdmissionControl(t *testing.T) {
Expand Down

0 comments on commit 9988384

Please sign in to comment.