预制redis数据


dir = "D://05性能测试//para//"
file_name = "redis_data_script"
fo = open(dir + file_name, "a",encoding='utf-8')
start_time = datetime.now()
for i in range(1000000,5000000):
   fo.write("*4" + "\n" + "$5" + "\n" + "setex" + "\n" + "$46" + "\n" + "LOGIN_SERVICE_2cb1ba580bef4577ac0ed91aa" + str(i) + "\n" + "$5" + "\n" + "86400" + "\n" + "$80" + "\n" + "{\"endPoint\":\"Applet\",\"companyId\":523144769413586666,\"userId\":530854902100926666}" + "\n")
fo.close()
end_time = datetime.now()
print(("总运行耗时: {}".format((end_time - start_time).seconds)))

posted @ 2019-01-11 19:08  ivon168  阅读(171)  评论(0编辑  收藏  举报