@@ -530,15 +530,15 @@ def parse_client_info(value):
530
530
"key1=value1 key2=value2 key3=value3"
531
531
"""
532
532
client_info = {}
533
- infos = value .split (" " )
533
+ infos = str_if_bytes ( value ) .split (" " )
534
534
for info in infos :
535
535
key , value = info .split ("=" )
536
536
client_info [key ] = value
537
537
538
538
# Those fields are definded as int in networking.c
539
539
for int_key in {"id" , "age" , "idle" , "db" , "sub" , "psub" ,
540
540
"multi" , "qbuf" , "qbuf-free" , "obl" ,
541
- "oll" , "omem" }:
541
+ "argv-mem" , " oll" , "omem" , "tot-mem " }:
542
542
client_info [int_key ] = int (client_info [int_key ])
543
543
return client_info
544
544
@@ -620,6 +620,7 @@ class Redis:
620
620
'CLIENT ID' : int ,
621
621
'CLIENT KILL' : parse_client_kill ,
622
622
'CLIENT LIST' : parse_client_list ,
623
+ 'CLIENT INFO' : parse_client_info ,
623
624
'CLIENT SETNAME' : bool_ok ,
624
625
'CLIENT UNBLOCK' : lambda r : r and int (r ) == 1 or False ,
625
626
'CLIENT PAUSE' : bool_ok ,
@@ -1243,6 +1244,13 @@ def client_kill_filter(self, _id=None, _type=None, addr=None, skipme=None):
1243
1244
"<value> must specify at least one filter" )
1244
1245
return self .execute_command ('CLIENT KILL' , * args )
1245
1246
1247
+ def client_info (self ):
1248
+ """
1249
+ Returns information and statistics about the current
1250
+ client connection.
1251
+ """
1252
+ return self .execute_command ('CLIENT INFO' )
1253
+
1246
1254
def client_list (self , _type = None ):
1247
1255
"""
1248
1256
Returns a list of currently connected clients.
0 commit comments