def _test_thinhash(conn): conn.delete('test') h = ThinHash('test', 10000, connection=conn) l = range(10) l.extend(range(10)) h.hmset(*l) assert list(h.hmget(*range(10))) == ['1', None, '3', None, '5', None, '7', None, '9', None]
def _test_thinhash(conn): conn.delete('test') h = ThinHash('test', 10000, connection=conn) l = range(10) l.extend(range(10)) h.hmset(*l) assert list(h.hmget(*range(10))) == [ '1', None, '3', None, '5', None, '7', None, '9', None ]
def check_thinhashsize(count=10000): thinhashkey = 'testthinhash' conn.flushall() h = ThinHash(thinhashkey, count, connection=conn) args = [] for _ in xrange(count): args.append(randid()) args.append(randts()) h.hmset(*args) print('it takes {} for {} thinhashs'.format(conn.info()['used_memory_human'], h.count()))
def check_thinhashsize(count=10000): thinhashkey = 'testthinhash' conn.flushall() h = ThinHash(thinhashkey, count, connection=conn) args = [] for _ in xrange(count): args.append(randid()) args.append(randts()) h.hmset(*args) print('it takes {} for {} thinhashs'.format( conn.info()['used_memory_human'], h.count()))