Fix redis cache benchmark.

This commit is contained in:
2024-06-28 13:37:31 +01:00
parent 3467cc5be0
commit eb9821dc3f
+5 -2
View File
@@ -4,6 +4,7 @@ import (
"testing"
"time"
"github.com/alicebob/miniredis/v2"
libpack_cache_memory "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/memory"
libpack_cache_redis "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/redis"
libpack_logger "github.com/lukaszraczylo/graphql-monitoring-proxy/logging"
@@ -37,8 +38,9 @@ func BenchmarkCacheLookupInMemory(b *testing.B) {
}
func BenchmarkCacheLookupRedis(b *testing.B) {
redis_server, _ := miniredis.Run()
mockedCache := libpack_cache_redis.New(&libpack_cache_redis.RedisClientConfig{
RedisServer: redisMockServer.Addr(),
RedisServer: redis_server.Addr(),
RedisDB: 0,
})
@@ -86,8 +88,9 @@ func BenchmarkCacheStoreInMemory(b *testing.B) {
}
func BenchmarkCacheStoreRedis(b *testing.B) {
redis_server, _ := miniredis.Run()
mockedCache := libpack_cache_redis.New(&libpack_cache_redis.RedisClientConfig{
RedisServer: redisMockServer.Addr(),
RedisServer: redis_server.Addr(),
RedisDB: 0,
})