diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7276a3e1e..10ab6a8db 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -169,6 +169,7 @@ jobs: output-file-path: output.txt github-token: ${{ secrets.GITHUB_TOKEN }} benchmark-data-dir-path: "benchmarks" + alert-threshold: "300%" fail-on-alert: true comment-on-alert: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} #summary-always: ${{ github.event_name != 'push' && github.event_name != 'workflow_dispatch' }} diff --git a/.github/workflows/test-redis.yml b/.github/workflows/test-redis.yml index 507ea8d6d..a4e58b6fa 100644 --- a/.github/workflows/test-redis.yml +++ b/.github/workflows/test-redis.yml @@ -56,7 +56,7 @@ jobs: --tls-auth-clients no & - name: Setup Redis Cluster - uses: vishnudxb/redis-cluster@1.0.8 + uses: vishnudxb/redis-cluster@1.0.9 with: master1-port: 7000 master2-port: 7001 @@ -64,6 +64,7 @@ jobs: slave1-port: 7003 slave2-port: 7004 slave3-port: 7005 + sleep-duration: 10 - name: Install Go uses: actions/setup-go@v4 diff --git a/.github/workflows/test-rueidis.yml b/.github/workflows/test-rueidis.yml index bf96d39ac..71307b502 100644 --- a/.github/workflows/test-rueidis.yml +++ b/.github/workflows/test-rueidis.yml @@ -43,7 +43,7 @@ jobs: --tls-ca-cert-file /home/runner/work/storage/storage/tls/ca.crt & - name: Setup Redis Cluster - uses: vishnudxb/redis-cluster@1.0.8 + uses: vishnudxb/redis-cluster@1.0.9 with: master1-port: 7000 master2-port: 7001 @@ -51,6 +51,7 @@ jobs: slave1-port: 7003 slave2-port: 7004 slave3-port: 7005 + sleep-duration: 10 - name: Install Go uses: actions/setup-go@v4 diff --git a/badger/badger_test.go b/badger/badger_test.go index 3e90ae9ee..d393d36c0 100644 --- a/badger/badger_test.go +++ b/badger/badger_test.go @@ -147,7 +147,7 @@ func Benchmark_Badger_Get(b *testing.B) { require.NoError(b, err) } -func Benchmark_Badger_Delete(b *testing.B) { +func Benchmark_Badger_SetAndDelete(b *testing.B) { b.ReportAllocs() b.ResetTimer() diff --git a/bbolt/bbolt_test.go b/bbolt/bbolt_test.go index e53918c93..565dd173c 100644 --- a/bbolt/bbolt_test.go +++ b/bbolt/bbolt_test.go @@ -136,7 +136,7 @@ func Benchmark_Bbolt_Get(b *testing.B) { require.NoError(b, err) } -func Benchmark_Bbolt_Delete(b *testing.B) { +func Benchmark_Bbolt_SetAndDelete(b *testing.B) { b.ReportAllocs() b.ResetTimer() diff --git a/memory/memory_test.go b/memory/memory_test.go index c5f75a246..c80fce93d 100644 --- a/memory/memory_test.go +++ b/memory/memory_test.go @@ -4,7 +4,6 @@ import ( "testing" "time" - "github.com/gofiber/utils/v2" "github.com/stretchr/testify/require" ) @@ -120,34 +119,6 @@ func Test_Storage_Memory_Conn(t *testing.T) { require.True(t, testStore.Conn() != nil) } -// go test -v -run=^$ -bench=Benchmark_Storage_Memory -benchmem -count=4 -func Benchmark_Storage_Memory(b *testing.B) { - keyLength := 1000 - keys := make([]string, keyLength) - for i := 0; i < keyLength; i++ { - keys[i] = utils.UUID() - } - value := []byte("joe") - - ttl := 2 * time.Second - b.Run("fiber_memory", func(b *testing.B) { - d := New() - b.ReportAllocs() - b.ResetTimer() - for n := 0; n < b.N; n++ { - for _, key := range keys { - d.Set(key, value, ttl) - } - for _, key := range keys { - _, _ = d.Get(key) - } - for _, key := range keys { - d.Delete(key) - } - } - }) -} - func Benchmark_Memory_Set(b *testing.B) { b.ReportAllocs() b.ResetTimer() diff --git a/sqlite3/sqlite3_test.go b/sqlite3/sqlite3_test.go index c07689be9..c7965ac1f 100644 --- a/sqlite3/sqlite3_test.go +++ b/sqlite3/sqlite3_test.go @@ -182,7 +182,7 @@ func Benchmark_SQLite3_Get(b *testing.B) { require.NoError(b, err) } -func Benchmark_SQLite3_Delete(b *testing.B) { +func Benchmark_SQLite3_SetAndDelete(b *testing.B) { b.ReportAllocs() b.ResetTimer()