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()))