码迷,mamicode.com
首页 > 其他好文 > 详细

预制redis数据

时间:2019-01-11 20:17:04      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:测试   script   datetime   encoding   red   rip   data   set   pen   


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

预制redis数据

标签:测试   script   datetime   encoding   red   rip   data   set   pen   

原文地址:https://www.cnblogs.com/perTest/p/10256825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!