【Furion】执行的csv文件未找到
发布日期:2021-06-30 21:35:43
浏览次数:3
分类:技术文章
本文共 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 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月16日 18时54分20秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
刷好老毛子系统进不了老毛子系统后台的解决办法
2019-04-30
Parallels Desktop 16 不能联网的解决办法
2019-04-30
手把手教你--jquery chosen插件的使用和API(html下拉框美化)
2019-04-30
solr修改schema文件(solr修改配置文件)
2019-04-30
select下拉框分组展示插件的使用--(select-mania插件的使用)
2019-04-30
Java Lambda表达式的应用--Stream API操作集合框架
2019-04-30
省市区三级联动插件Distpicker--前端实现地区三级联动
2019-04-30
solr的使用详解
2019-04-30
Myslq连接(JDBC)url属性的参数的设置
2019-04-30
关于Java继承,重载及运行的顺序的总结
2019-04-30
关于Spring MVC与前端的交互
2019-04-30
常用的 Maven 命令
2019-04-30
数据结构之顺序表的实现
2019-04-30
数据结构之线性链表
2019-04-30
JQuery使用validate插件完成校验
2019-04-30
关于java的内部类
2019-04-30
一个简单的layui登陆界面
2019-04-30
使用Spring Boot写一个简单的Hello World
2019-04-30