from threadpool import ThreadPool, makeRequests
from sseclient import SSEClient
import time
def connect(a):
time.sleep(a % 1)
# sse长连接请求结果,将实时打印返回的数据响应
messages = SSEClient('url')
for msg in messages:
if msg == "":
print("返回数据为空")
else:
print(msg)
if __name__ == "__main__":
# 设置并发连接数
pool = ThreadPool(100)
test = list()
for i in range(100):
test.append(i)
result = makeRequests(connect, test)
[pool.putRequest(req) for req in result]
pool.wait()
相关文章
- 04-11python_sse长连接压测
- 04-11locust分布式压测--主从连接
- 04-11locust分布式压测--主从连接
- 04-11问题追查:QA压测工具http长连接总是被服务端close情况
- 04-11Jmeter连接postgresql数据库进行压测
- 04-11第八篇 -- 对数据库mysql进行连接并压测
- 04-11mysql 1040 too many connections,压测接口500提示数据库连接到达上限解决方案
- 04-11swingbench window远程连接非默认端口压测方式
- 04-11mysql 1040 too many connections,压测接口500提示数据库连接到达上限解决方案
- 04-11百万长连接压测问题排查分析