The locust chart shows that data is still being recorded after the timed run time expires #2910
Closed
Description
Prerequisites
- I am using the latest version of Locust
- I am reporting a bug, not asking a question
Description
When I started locust, I set a scheduled operation task for 2.5 hours. After the completion of the task, the report shows that the task is executed in 2024/9/23 22:01:07 to 2024/9/24 00:31:07. However, when I check the report on the web interface at 2024/9/24 08:09:00, Found that the timeline of the chart goes straight to 2024/9/24 08:09:00
Command line
locust -f ./locust_run.py --master --master-bind-port=8682 --web-port=8677
Locustfile contents
import sys
from os.path import dirname
from os.path import join
# 初始化项目路径
per_path = dirname(__file__)
project_path = dirname(per_path)
sys.path.append(project_path)
aurora_path = dirname(dirname(project_path))
sys.path.append(aurora_path)
# 基础导包
from queue import Queue
from copy import copy
from locust import FastHttpUser, between
from locust import events
from 配置中心.业务路由 import xenv
from 应用基础库.性能测试.数据服务前置 import data_share_setup
# 测试脚本导入
from 测试用例.xxxx测试脚本 import MainCasePaper
# 请求时间间隔
start, end = 0, 3
data = Queue()
# 定义User实例
class MyUser(FastHttpUser):
"""用户类"""
# abstract = True # 是否有子类
wait_time = between(start, end)
# 测试脚本注册
tasks = [MainCasePaper]
# host = 'https://xxxxx.xxxx/xxx' # 生产域名
host = 'https://xx.x.x.xxxx:xxxx/xxx' # 生产内网IP
# 读取共享数据(浅拷贝原因: event回调函数在后面执行加载数据)
share_data = copy(data)
network_timeout = 10
# 加载纸质中奖票
ticket_data = Queue()
with open(join(per_path,'数据中心','zz_ls_djp_copy.txt'),'r') as fp:
for i in fp:
ticket_data.put_nowait(i.rstrip('\n'))
@events.init.add_listener
def on_locust_init(environment, **kw):
"""前置初始化操作"""
# 地址拼接
config_path = join(per_path, '参数配置', '参数配置.sh')
data_path = join(per_path, '数据中心', '数据池.csv')
data_share_path = join(aurora_path, '应用基础库', '性能测试', '数据共享服务.py')
# 数据共享服务启动
data_share_setup(environment, data, config_path, data_path, data_share_path)
Python version
3.9.9
Locust version
2.31.6
Operating system
Huawei Cloud EulerOS (Linux)