Commit a6ee3ca6 authored by liyuanhong's avatar liyuanhong

增加了临时日志的当前时间

parent 629b8c84
......@@ -18,12 +18,12 @@ class SendMultMsgThread():
self.msg = msg
self.timeOut = 30 #socket超时时间
self.BUF_SIZE = 1024 #接收消息缓存
self.threadCount = 100 #并发线程数
self.threadCount = 6000 #并发线程数
self.totalTime = 0 #所有线程的运行总和
self.threadArr = {} #保存每个线程的信息
self.failThreadCount = 0 #失败线程数
self.durThreads = [] #持续发送线程数组,当数组为空,表示所有线程已经结束
self.durTime = 20 #线程持续时间
self.durTime = 120 #线程持续时间
self.connectTimeoutNum = 0 #连接超时线程数
self.sendTimeoutNum = 0 #发送超时线程数
self.reviceTimeoutNum = 0 #接收超时线程数
......@@ -205,6 +205,9 @@ class SendMultMsgThread():
print("剩余线程数:" + str(len(self.durThreads)))
timeArray = time.localtime(timeStart / 1000)
testStart = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
timeCur = int(time.time() * 1000)
timeArray = time.localtime(timeCur / 1000)
testCur = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
info_0 = "-------------------------- 统计信息(pre) --------------------------"
info_1 = "耗时:" + str(timeExpend) + " 毫秒产生了" + str(self.threadCount) + "线程"
info_2 = "开始测试时间:" + testStart
......@@ -214,8 +217,9 @@ class SendMultMsgThread():
info_8 = "连接失败:" + str(self.connectTimeoutNum)
info_9 = "发送失败:" + str(self.sendTimeoutNum)
info_10 = "接收失败:" + str(self.reviceTimeoutNum)
info_11 = "当前写入时间:" + testCur
result = info_0 + "\n" + info_1 + "\n" + info_2 + "\n" + info_4 + "\n" + info_5 + "\n" + info_6 + "\n"
result = result + info_8 + "\n" + info_9 + "\n" + info_10 + "\n"
result = result + info_8 + "\n" + info_9 + "\n" + info_10 + "\n" + info_11 + "\n"
self.writeToFile("./result_pre.txt",result)
time.sleep(5)
timeArray = time.localtime(timeStart / 1000)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment