Skip to content

Commit a26d7eb

Browse files
Allow 6 values in Keyspace parsing (#1076)
* Allow 6 values in Keyspace parsing Dragonflydb v1.35.0 returns 6 values for each db. * fix condition, fix tests --------- Co-authored-by: Oliver <oliver@21zoo.com>
1 parent 623a3bc commit a26d7eb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

exporter/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func parseDBKeyspaceString(inputKey string, inputVal string) (keysTotal float64,
249249
}
250250

251251
split := strings.Split(inputVal, ",")
252-
if len(split) < 2 || len(split) > 4 {
252+
if len(split) < 2 {
253253
log.Debugf("parseDBKeyspaceString strings.Split(inputVal) invalid: %#v", split)
254254
return
255255
}

exporter/info_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestKeyspaceStringParser(t *testing.T) {
3131
{db: "db3", stats: "keys=123,expires=0,avg_ttl=zzz", ok: false},
3232
{db: "db3", stats: "keys=1,expires=0,avg_ttl=zzz,cached_keys=0", ok: false},
3333
{db: "db3", stats: "keys=1,expires=0,avg_ttl=0,cached_keys=zzz", ok: false},
34-
{db: "db3", stats: "keys=1,expires=0,avg_ttl=0,cached_keys=0,extra=0", ok: false},
34+
{db: "db3", stats: "keys=1,expires=0,avg_ttl=0,cached_keys=0,extra=0", keysTotal: 1, keysEx: 0, avgTTL: 0, keysCached: 0, ok: true},
3535

3636
{db: "db0", stats: "keys=1,expires=0,avg_ttl=0", keysTotal: 1, keysEx: 0, avgTTL: 0, keysCached: -1, ok: true},
3737
{db: "db0", stats: "keys=1,expires=0,avg_ttl=0,cached_keys=0", keysTotal: 1, keysEx: 0, avgTTL: 0, keysCached: 0, ok: true},

0 commit comments

Comments
 (0)