Skip to content

Commit c05af62

Browse files
Introduce client side caching benchmark capabilities. Enable rueidis/radix underlying vanilla client selection (#31)
* First CSC POC using a fork of ruedis * Added replica test to CI. Enabled all features on the rueidis variation * Fixed CI service image
1 parent 2eda50c commit c05af62

File tree

10 files changed

+272
-30
lines changed

10 files changed

+272
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist
55
*.json
66
dump.rdb
77
.coverdata
8+
.DS_Store

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ GIT_DIRTY:=$(shell git diff --no-ext-diff 2> /dev/null | wc -l)
2121
endif
2222

2323
.PHONY: all test coverage
24-
all: test build
24+
all: build
2525

2626
build-coverage:
2727
$(GOBUILD) -cover \

commands.go

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package main
2+
3+
var readOnlyCommands = map[string]bool{
4+
"LLEN": true,
5+
"DUMP": true,
6+
"PTTL": true,
7+
"GEOHASH": true,
8+
"HEXISTS": true,
9+
"GROUPS": true,
10+
"GET": true,
11+
"SSCAN": true,
12+
"TOUCH": true,
13+
"CONSUMERS": true,
14+
"BITCOUNT": true,
15+
"MGET": true,
16+
"SUBSTR": true,
17+
"HVALS": true,
18+
"TTL": true,
19+
"FREQ": true,
20+
"XREAD": true,
21+
"PFCOUNT": true,
22+
"ZREVRANGEBYSCORE": true,
23+
"HMGET": true,
24+
"LINDEX": true,
25+
"XLEN": true,
26+
"GEODIST": true,
27+
"ZLEXCOUNT": true,
28+
"LPOS": true,
29+
"ZREVRANK": true,
30+
"GEORADIUS_RO": true,
31+
"GETRANGE": true,
32+
"STRLEN": true,
33+
"REFCOUNT": true,
34+
"IDLETIME": true,
35+
"SCARD": true,
36+
"EXPIRETIME": true,
37+
"ZRANGE": true,
38+
"LOLWUT": true,
39+
"SINTER": true,
40+
"XREVRANGE": true,
41+
"ZRANGEBYSCORE": true,
42+
"SUNION": true,
43+
"GETBIT": true,
44+
"BITFIELD_RO": true,
45+
"ZDIFF": true,
46+
"HGETALL": true,
47+
"ZSCORE": true,
48+
"ZREVRANGE": true,
49+
"ZREVRANGEBYLEX": true,
50+
"SINTERCARD": true,
51+
"SMISMEMBER": true,
52+
"KEYS": true,
53+
"LCS": true,
54+
"SORT_RO": true,
55+
"ZRANK": true,
56+
"HSTRLEN": true,
57+
"LRANGE": true,
58+
"PEXPIRETIME": true,
59+
"RANDOMKEY": true,
60+
"SMEMBERS": true,
61+
"ZMSCORE": true,
62+
"HKEYS": true,
63+
"ZCOUNT": true,
64+
"ZSCAN": true,
65+
"GEOSEARCH": true,
66+
"ZUNION": true,
67+
"XPENDING": true,
68+
"HRANDFIELD": true,
69+
"HLEN": true,
70+
"ZRANDMEMBER": true,
71+
"DBSIZE": true,
72+
"SDIFF": true,
73+
"STREAM": true,
74+
"ZINTER": true,
75+
"SCAN": true,
76+
"TYPE": true,
77+
"USAGE": true,
78+
"ZINTERCARD": true,
79+
"SISMEMBER": true,
80+
"HGET": true,
81+
"SRANDMEMBER": true,
82+
"ENCODING": true,
83+
"EXISTS": true,
84+
"GEOPOS": true,
85+
"XRANGE": true,
86+
"ZRANGEBYLEX": true,
87+
"GEORADIUSBYMEMBER_RO": true,
88+
"BITPOS": true,
89+
"ZCARD": true,
90+
"HSCAN": true,
91+
}

common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
)
1313

1414
var totalCommands uint64
15+
var totalCached uint64
1516
var totalErrors uint64
1617
var latencies *hdrhistogram.Histogram
1718
var benchmarkCommands arrayStringParameters
@@ -23,6 +24,7 @@ const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
2324
type datapoint struct {
2425
success bool
2526
duration_ms int64
27+
cachedEntry bool
2628
}
2729

2830
func stringWithCharset(length int, charset string) string {

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ require (
66
github.com/HdrHistogram/hdrhistogram-go v1.1.0
77
github.com/mattn/go-shellwords v1.0.12
88
github.com/mediocregopher/radix/v4 v4.1.2
9-
github.com/rueian/rueidis v0.0.100
9+
github.com/redis/rueidis v1.0.19
1010
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
1111
)
1212

1313
require (
1414
github.com/tilinna/clock v1.0.2 // indirect
1515
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 // indirect
1616
)
17+
18+
replace github.com/redis/rueidis => github.com/filipecosta90/rueidis v0.0.0-20230927221707-2d17d4ee82e3

go.sum

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
77
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
88
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
99
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
10+
github.com/filipecosta90/rueidis v0.0.0-20230927221707-2d17d4ee82e3 h1:slwoBsdbPe8JqOhlEaEZzkog/PLSwAQGuW3QtkIRsNM=
11+
github.com/filipecosta90/rueidis v0.0.0-20230927221707-2d17d4ee82e3/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo=
1012
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
1113
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
1214
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -22,11 +24,11 @@ github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lL
2224
github.com/mediocregopher/radix/v4 v4.1.2 h1:Pj7XnNK5WuzzFy63g98pnccainAePK+aZNQRvxSvj2I=
2325
github.com/mediocregopher/radix/v4 v4.1.2/go.mod h1:ajchozX/6ELmydxWeWM6xCFHVpZ4+67LXHOTOVR0nCE=
2426
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
25-
github.com/onsi/gomega v1.27.5 h1:T/X6I0RNFw/kTqgfkZPcQ5KU6vCnWNBGdtrIx2dpGeQ=
27+
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
2628
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
2729
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
28-
github.com/rueian/rueidis v0.0.100 h1:22yp/+8YHuWc/vcrp8bkjeE7baD3vygoh2gZ2+xu1KQ=
29-
github.com/rueian/rueidis v0.0.100/go.mod h1:ivvsRYRtAUcf9OnheuKc5Gpa8IebrkLT1P45Lr2jlXE=
30+
github.com/redis/rueidis v1.0.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo=
31+
github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo=
3032
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
3133
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
3234
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
@@ -52,14 +54,14 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
5254
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
5355
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
5456
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
55-
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
57+
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
5658
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
5759
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
5860
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5961
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6062
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6163
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
62-
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
64+
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
6365
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs=
6466
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
6567
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

0 commit comments

Comments
 (0)