addok/shell.py
def do_DBINFO(self, *args):
        """Print some useful infos from Redis DB."""
        info = DB.info()
        keys = [
            'keyspace_misses', 'keyspace_hits', 'used_memory_human',
            'total_commands_processed', 'total_connections_received',
            'connected_clients']
        for key in keys:
            print('{}: {}'.format(white(key), blue(info[key])))
        nb_of_redis_db = int(DB.config_get('databases')['databases'])
        for db_index in range(nb_of_redis_db - 1):
            db_name = 'db{}'.format(db_index)
            if db_name in info:
                label = white('nb keys (db {})'.format(db_index))
                print('{}: {}'.format(label, blue(info[db_name]['keys'])))
def do_DBINFO(self, *args):
        """Print some useful infos from Redis DB."""
        info = DB.info()
        keys = [
            'keyspace_misses', 'keyspace_hits', 'used_memory_human',
            'total_commands_processed', 'total_connections_received',
            'connected_clients']
        for key in keys:
            print('{}: {}'.format(white(key), blue(info[key])))
        nb_of_redis_db = int(DB.config_get('databases')['databases'])
        for db_index in range(nb_of_redis_db - 1):
            db_name = 'db{}'.format(db_index)
            if db_name in info:
                label = white('nb keys (db {})'.format(db_index))
                print('{}: {}'.format(label, blue(info[db_name]['keys'])))
def do_DBINFO ( self , * args ) : info = DB . info ( ) keys = [ 'keyspace_misses' , 'keyspace_hits' , 'used_memory_human' , 'total_commands_processed' , 'total_connections_received' , 'connected_clients' ] for key in keys : print ( '{}: {}' . format ( white ( key ) , blue ( info [ key ] ) ) ) nb_of_redis_db = int ( DB . config_get ( 'databases' ) [ 'databases' ] ) for db_index in range ( nb_of_redis_db - 1 ) : db_name = 'db{}' . format ( db_index ) if db_name in info : label = white ( 'nb keys (db {})' . format ( db_index ) ) print ( '{}: {}' . format ( label , blue ( info [ db_name ] [ 'keys' ] ) ) )
Print some useful infos from Redis DB.
Print some useful infos from Redis DB .