参考原文性能测试工具 nGrinder 项目剖析及二次开发 - 灰信网(软件开发博客聚合)
1、原文中需要调整的地方
ngrinder-core模块下build.gradle依赖添加jar包
implementation (group: "org.apache.commons", name: "commons-math3", version: "3.6.1")
PerfTest.java新增属性maxRT的getMaxRT()内需要更改为return maxRT;
2、前端代码修改位置
ngrinder3.5.5-p1版本和上述引用的版本代码发生了较大的变化,此3.5.5-p1版本前端不是基于模版而是基于vue,其他java代码按前面引用文章链接修改即可,重点说下前端需要修改的位置
3、Report.vue修改内容
export default class Report组件增加指标
4、DetailReport.vue修改内容
<table class="table table-bordered compact-padding">节点下增加如下内容
<!-- liangzhilin -->
<!-- 新增 错误率,TPS标准差,TPS波动率,最小RT, 最大RT, RT 25/50/75/80/85/90/95/99百分位数 -->
<tr>
<th v-text="i18n('perfTest.report.errorRate')"></th>
<td>{{ test.errors /(test.tests + test.errors) | numFormat('0,0.00') }}</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.tpsStd')"></th>
<td>{{test.tpsStd | numFormat('0,0.00') }}</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.tpsVix')"></th>
<td>{{test.tpsVix | numFormat('0,0.00') }}</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.minRT')"></th>
<td>{{test.minRT | numFormat('0,0.00') }}</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.FiftyMeanTime')"></th>
<td>
<span>{{ test.fiftyMeanTime | numFormat('0,0.00') }}</span>
<code class="ml-1">ms</code>
</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.NinetyMeanTime')"></th>
<td>
<span>{{ test.ninetyMeanTime | numFormat('0,0.00') }}</span>
<code class="ml-1">ms</code>
</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.NinetyFiveMeanTime')"></th>
<td>
<span>{{ test.ninetyFiveMeanTime | numFormat('0,0.00') }}</span>
<code class="ml-1">ms</code>
</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.NinetyNineMeanTime')"></th>
<td>
<span>{{ test.ninetyNineMeanTime | numFormat('0,0.00') }}</span>
<code class="ml-1">ms</code>
</td>
</tr>
<tr>
<th v-text="i18n('perfTest.report.maxRT')"></th>
<td>
<span>{{ test.maxRT | numFormat('0,0.00') }}</span>
<code class="ml-1">ms</code>
</td>
</tr>
5、报告展示