Commit 32643254 authored by liyuanhong's avatar liyuanhong

优化了压力测试脚本

parent d975ac0c
......@@ -47,11 +47,10 @@ def getPressTestObj():
def flvFilePushTest():
isLoop = 1 # 是否循环压力测试 0: 不循环 1:循环
loopTime = 1 * 60 * 60 # 循环压力测试的时长
test = getPressTestObj()
logger.info("-----------------------------启动新一轮压力测试-----------------------------")
threadInfo = test.getThreadInfo()
threadInfoPull = test.getThreadInfoPull()
logger.info("剩余推流线程:" + str(len(threadInfo["threadObj"])))
logger.info("剩余拉流线程:" + str(len(threadInfoPull["threadObj"])))
if isLoop == 0:
......@@ -62,10 +61,9 @@ def flvFilePushTest():
threadInfo = test.getThreadInfo()
threadInfoPull = test.getThreadInfoPull()
else:
time.sleep(10)
time.sleep(30)
if len(threadInfo["threadObj"]) == 0 and len(threadInfoPull["threadObj"]) == 0:
test = getPressTestObj()
logger.info("-----------------------------启动新一轮压力测试-----------------------------")
threadInfo = test.getThreadInfo()
threadInfoPull = test.getThreadInfoPull()
while len(threadInfo["threadObj"]) != 0 and len(threadInfoPull["threadObj"]) != 0:
......@@ -76,7 +74,7 @@ def flvFilePushTest():
threadInfoPull = test.getThreadInfoPull()
flvFilePushTest()
logger.info("压力测试结束")
logger.info("压力测试结束!!!!!!")
if __name__ == "__main__":
......
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