修改请求统计表格

This commit is contained in:
shiziyuan9527 2020-03-24 16:07:52 +08:00
parent 55d7a806fd
commit 16f16ab89d
4 changed files with 64 additions and 69 deletions

View File

@ -84,7 +84,7 @@ public class JtlResolver {
RequestStatistics requestStatistics = new RequestStatistics(); RequestStatistics requestStatistics = new RequestStatistics();
requestStatistics.setRequestLabel(label); requestStatistics.setRequestLabel(label);
requestStatistics.setSamples(index+""); requestStatistics.setSamples(index);
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.00");
String s = df.format((float)sumElapsed/index); String s = df.format((float)sumElapsed/index);
requestStatistics.setAverage(s+""); requestStatistics.setAverage(s+"");

View File

@ -6,7 +6,7 @@ public class RequestStatistics {
private String requestLabel; private String requestLabel;
/**压测请求数*/ /**压测请求数*/
private String samples; private Integer samples;
/**平均响应时间*/ /**平均响应时间*/
private String average; private String average;
@ -43,11 +43,11 @@ public class RequestStatistics {
this.requestLabel = requestLabel; this.requestLabel = requestLabel;
} }
public String getSamples() { public Integer getSamples() {
return samples; return samples;
} }
public void setSamples(String samples) { public void setSamples(Integer samples) {
this.samples = samples; this.samples = samples;
} }

View File

@ -255,8 +255,8 @@ public class JtlTest {
RequestStatistics sceneResult = new RequestStatistics(); RequestStatistics sceneResult = new RequestStatistics();
sceneResult.setRequestLabel(label); sceneResult.setRequestLabel(label);
sceneResult.setSamples(index+""); sceneResult.setSamples(index);
sceneResult.setAverage(sumElapsed/index+""); // sceneResult.setAverage(sumElapsed/index);
sceneResult.setTp90(elapsedList.get(tp90)+""); sceneResult.setTp90(elapsedList.get(tp90)+"");
sceneResult.setTp95(elapsedList.get(tp95)+""); sceneResult.setTp95(elapsedList.get(tp95)+"");
sceneResult.setTp99(elapsedList.get(tp99)+""); sceneResult.setTp99(elapsedList.get(tp99)+"");

View File

@ -2,78 +2,73 @@
<div> <div>
<el-table <el-table
:data="tableData" :data="tableData"
stripe
border border
style="width: 100%" style="width: 100%"
:default-sort = "{prop: 'samples'}" show-summary
:default-sort = "{prop: 'samples', order: 'descending'}"
> >
<el-table-column label="Requests" fixed width="450" align="center">
<el-table-column <el-table-column
prop="requestLabel" prop="requestLabel"
label="Element Label" label="Label"
fixed width="450"/>
width="450"
>
</el-table-column> </el-table-column>
<el-table-column label="Executions" align="center">
<el-table-column <el-table-column
prop="samples" prop="samples"
label="Samples" label="Samples"
width="150" sortable
sortable> width="110"
/>
<el-table-column
prop="errors"
label="Error%"
align="center"
fixed="right"/>
</el-table-column> </el-table-column>
<el-table-column label="Response Times(ms)" align="center">
<el-table-column <el-table-column
prop="average" prop="average"
label="Avg Response Time(ms)" label="Average"
width="220" />
>
</el-table-column>
<el-table-column
prop="avgHits"
label="Avg Hits/s"
width="150"
>
</el-table-column>
<el-table-column
prop="tp90"
label="90% line(ms)"
width="150"
>
</el-table-column>
<el-table-column
prop="tp95"
label="95% line(ms)"
width="150"
>
</el-table-column>
<el-table-column
prop="tp99"
label="99% line(ms)"
width="150"
>
</el-table-column>
<el-table-column <el-table-column
prop="min" prop="min"
label="Min Response Time(ms)" label="Min"
width="220" />
>
</el-table-column>
<el-table-column <el-table-column
prop="max" prop="max"
label="Max Response Time(ms)" label="Max"
width="220" />
> <el-table-column
prop="tp90"
label="90% line"
/>
<el-table-column
prop="tp95"
label="95% line"
/>
<el-table-column
prop="tp99"
label="99% line"
/>
</el-table-column> </el-table-column>
<!-- <el-table-column-->
<!-- prop="avgHits"-->
<!-- label="Avg Hits/s"-->
<!-- width="150"-->
<!-- />-->
<el-table-column <el-table-column
prop="kbPerSec" prop="kbPerSec"
label="Avg Bandwidth(KBytes/s)" label="Avg Bandwidth(KBytes/s)"
width="220" align="center"
> width="200"
</el-table-column> />
<el-table-column
prop="errors"
label="Error Percentage"
width="180"
fixed="right"
>
</el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>