mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-12 05:32:36 +00:00
Fix redis cache benchmark.
This commit is contained in:
Vendored
+5
-2
@@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/alicebob/miniredis/v2"
|
||||||
libpack_cache_memory "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/memory"
|
libpack_cache_memory "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/memory"
|
||||||
libpack_cache_redis "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/redis"
|
libpack_cache_redis "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/redis"
|
||||||
libpack_logger "github.com/lukaszraczylo/graphql-monitoring-proxy/logging"
|
libpack_logger "github.com/lukaszraczylo/graphql-monitoring-proxy/logging"
|
||||||
@@ -37,8 +38,9 @@ func BenchmarkCacheLookupInMemory(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkCacheLookupRedis(b *testing.B) {
|
func BenchmarkCacheLookupRedis(b *testing.B) {
|
||||||
|
redis_server, _ := miniredis.Run()
|
||||||
mockedCache := libpack_cache_redis.New(&libpack_cache_redis.RedisClientConfig{
|
mockedCache := libpack_cache_redis.New(&libpack_cache_redis.RedisClientConfig{
|
||||||
RedisServer: redisMockServer.Addr(),
|
RedisServer: redis_server.Addr(),
|
||||||
RedisDB: 0,
|
RedisDB: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -86,8 +88,9 @@ func BenchmarkCacheStoreInMemory(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkCacheStoreRedis(b *testing.B) {
|
func BenchmarkCacheStoreRedis(b *testing.B) {
|
||||||
|
redis_server, _ := miniredis.Run()
|
||||||
mockedCache := libpack_cache_redis.New(&libpack_cache_redis.RedisClientConfig{
|
mockedCache := libpack_cache_redis.New(&libpack_cache_redis.RedisClientConfig{
|
||||||
RedisServer: redisMockServer.Addr(),
|
RedisServer: redis_server.Addr(),
|
||||||
RedisDB: 0,
|
RedisDB: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user