标签:
# 目前redis用的还比较少,主要是用了get,set
# 偶尔会用一下zadd, zrange 但是也没有深入的用法
#coding=utf-8 __author__ = ‘Administrator‘ import redis r = redis.Redis(host=‘192.168.16.203‘, port=6379, db=0) # info = r.info() # for key in info.keys(): # print ‘%s: %s‘ % (key, info[key]) key_list = r.keys() max = 0 min = 10000 for key in key_list: value = r.zrange(key,0,-1) if len(value)> max: max = len(value) max_key = key if len(value)<min: min = len(value) min_key = key max_value = r.zrange(max_key,0,-1) print "\n".join(max_value) print max min_value = r.zrange(min_key,0,-1) print "\n".join(min_value) print min # # # get the records of all test ue # CORRECT_RECORDS_NUM = 3001 # wrong_ue_list = [] # key_list_sort = sorted(key_list) # for key in key_list: # value = r.zrange(key, 0, -1) # if len(value)!=CORRECT_RECORDS_NUM: # wrong_ue_list.append(key) # key_list_sort.remove(key) # # # get response time and response content # base_result = r.zrange(key_list_sort[0], 0, -1) # delay_list = [] # for key in key_list_sort: # result = r.zrange(key, 0, -1) # get a list of dicts # # # # # # for i in key_list: # value = r.get(i) # # # def parse_value(value): # import cPickle as p # print p.loads(value) #
标签:
原文地址:http://www.cnblogs.com/yeyong/p/4595209.html