JMeter与大模型融合应用之JMeter线程组新增指导文档

JMeter与大模型融合应用之JMeter线程组新增指导文档

需求描述

针对JMeter使用不习惯的用户,直接在添加对应的组件上提供帮助文档,以线程组为例。我们需要完成如下效果:

第一:提供内外网的帮助文档:

第二:中英文切换后,能够显示正确的内容:

业务实现

第一步:我们在路径\apache-jmeter-5.1\src\core\org\apache\jmeter\threads\gui下找到对应的源码文件ThreadGroupGui.java中我们找到对应private void init() 方法,并且添加如下代码:

java 复制代码
private void init() { // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
        //创建帮助手册
       VerticalPanel helpPanel = new VerticalPanel();
       helpPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
               JMeterUtils.getResString("help_properties"))); // $NON-NLS-1$
       // 创建超链接标签
       String labelText1 = "<html><a href=\"https://alidocs.dingtalk.com/i/nodes/Gl6Pm2Db8D3xgZdvizdOBDA1JxLq0Ee4?doc_type=wiki_doc# 「JMeter自带线程组」\">" + JMeterUtils.getResString("inside_net") + "</a></html>";
       String labelText2 = "<html><a href=\"https://samzhang.blog.csdn.net/article/details/139174013\">" + JMeterUtils.getResString("outside_net") + "</a></html>";
       JLabel linkLabel1 = new JLabel(labelText1);
       JLabel linkLabel2 = new JLabel(labelText2);
       helpPanel.add(linkLabel1);
       helpPanel.add(linkLabel2);
    //代码省略
}

第二步:找到中英文翻译的配置文件\apache-jmeter-5.1\src\core\org\apache\jmeter\resources中的messages_zh_CN.properties配置文件,新增内容如下

properties 复制代码
help_properties=对应组件帮助文档
inside_net=内网文档
outside_net=外网文档

第三步:在上述同一个路径下找到messages.properties配置文件,新增内容如下

properties 复制代码
help_properties=Helpful Docs
inside_net=Inside Net Docs
outside_net=Outside Net Docs

至此,我们的相关内容已经开发完成。

相关推荐
zizisuo3 天前
使用jmeter做压力测试
jmeter·压力测试
惜.己7 天前
jmeter中java.net.ConnectException: Connection refused: connect
java·jmeter·.net
BatyTao7 天前
Fiddler抓包+Jmeter实战之--jxycrm客户关系管理软件
jmeter·fiddler
新知图书13 天前
JMeter的取样器
jmeter
小蝙蝠侠13 天前
JMeter 执行流程
java·jmeter
低音钢琴13 天前
JMeter中常用的配置优化
测试工具·jmeter
瑞瑞绮绮13 天前
Jmeter-初步使用
jmeter
文人sec13 天前
性能测试-jmeter15-性能项目计划流
分布式·jmeter·性能优化·grafana·prometheus·模块测试
BatyTao17 天前
第十三章 Ant与Jenkins的集成
jmeter·jenkins·ant