【Furion】执行的csv文件未找到
发布日期:2021-06-30 21:35:43
浏览次数:4
分类:技术文章
本文共 2611 字,大约阅读时间需要 8 分钟。
在furion平台启动性能测试任务时,20台肉鸡,每台肉鸡1000个并发线程,但是实际日志收集到到信息仅仅1000个线程,查看肉鸡的日志:
问题定位
- 查看对应路径的文件
- 很明显该文件存在,打开文件,文件内容正常
- 还是看看具体的报错信息吧,定位到具体的代码段信息
/** * Creates an association between a filename and a File inputOutputObject, * and stores it for later use - unless it is already stored. * * @param filename - relative (to base) or absolute file name (must not be null or empty) * @param charsetName - the character set encoding to use for the file (may be null) * @param alias - the name to be used to access the object (must not be null) * @param hasHeader true if the file has a header line describing the contents * @return the header line; may be null * @throws IllegalArgumentException if header could not be read or filename is null or empty */ public synchronized String reserveFile(String filename, String charsetName, String alias, boolean hasHeader) { if (filename == null || filename.isEmpty()){ throw new IllegalArgumentException("Filename must not be null or empty"); } if (alias == null){ throw new IllegalArgumentException("Alias must not be null"); } FileEntry fileEntry = files.get(alias); if (fileEntry == null) { fileEntry = new FileEntry(resolveFileFromPath(filename), null, charsetName); if (filename.equals(alias)){ log.info("Stored: {}", filename); } else { log.info("Stored: {} Alias: {}", filename, alias); } files.put(alias, fileEntry); if (hasHeader) { try { fileEntry.headerLine = readLine(alias, false); if (fileEntry.headerLine == null) { fileEntry.exception = new EOFException("File is empty: " + fileEntry.file); } } catch (IOException | IllegalArgumentException e) { fileEntry.exception = e; } } } if (hasHeader && fileEntry.headerLine == null) { throw new IllegalArgumentException("Could not read file header line for file " + filename, fileEntry.exception); } return fileEntry.headerLine; }
从代码中读取文件fileEntry.headerLine = readLine(alias, false);
,找不到文件时异常处理 fileEntry.exception = e;
,将异常赋值给fileEntry.exception
ps:在一开始的现象中,仅仅有一台肉鸡可以正常运行,因为第一次同步csv文件时仅仅同步给了那一台肉鸡且运行
解决方案
- 修改jmeter源码修复这个问题,去掉异常赋值等方式
- 从源码中可以看到
hasHeader
也是其中一个判断因素,在jmeter的脚本jmx文件中,可以将该属性配置为False
根据方案2修改后再次执行,果然解决问题
转载地址:https://lluozh.blog.csdn.net/article/details/108747379 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
关注你微信了!
[***.104.42.241]2024年04月07日 16时42分53秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
闭关三月!猛男逆道而行,四杀斩获阿里 / 腾讯 / 京东 / 百度等大厂 offer
2019-05-01
上线三天获 22w 浏览量!2021 最新一线大厂 Java 高级架构师面试题总结~
2019-05-01
电信物联网平台SOTA升级(软件升级)的全流程说明
2019-05-01
电信物联网平台插件开发相关总结
2019-05-01
ARM之一 分散加载文件(scatter)详述
2019-05-01
centos6 python3.6 安装配置jupyer
2019-05-01
CDH5.14 spark2.4.0配置python3 以及读取hive表
2019-05-01
VMware安装centos7.2后配置网络并设置固定ip
2019-05-01
在 centos7.2安装docker 并设置阿里云源
2019-05-01
centos7.2 将mysql添加到服务中
2019-05-01
【linux用户模块】/etc/passwd的字段含义
2019-05-01
【linux用户模块】用户/用户组的管理
2019-05-01
【大数据】【调度】Airflow 和 Azkaban的选型
2019-05-01
用zabbix监控nginx
2019-05-01
计算机网络 —— 数据链路层 3.
2019-05-01
计算机网络 —— 网络层 1.
2019-05-01