Python-利用JMeter的Summariser日志绘制负载测试曲线

本文介绍了如何在JMeter性能测试中利用Summariser生成简洁的日志,并详细解析了Summariser日志的配置与格式。接着,文章通过Concurrency Thread Group和Python脚本`summary.py`,演示了如何分析这些日志并绘制负载测试的性能曲线。
摘要由CSDN通过智能技术生成

1 Summariser日志

JMeter性能测试时,运行很长时间,会产生大量日志,分析起来会比较困难;
如何解决?
JMeter提供了summariser result report,就是在每隔一段时间打一行统计日志,这样日志会大大减少。

1.1 配置

JMeter summariser report的设置在:$JMete_Home/bin/jmeter.properties

#---------------------------------------------------------------------------
# Summariser - Generate Summary Results - configuration (mainly applies to non-GUI mode)
#---------------------------------------------------------------------------
#
# Define the following property to automatically start a summariser with that name
# (applies to non-GUI mode only)
summariser.name=summary
#
# interval between summaries (in seconds) default 3 minutes
summariser.interval=180
#
# Write messages to log file
summariser.log=true
#
# Write messages to System.out
#summariser.out=true

以上设置完成后,jmeter.log中才会有summariser result report( Applies to CLI mode only,仅在命令行模式生效),每隔3分钟向jmeter.log中写入一行log;

1.2 说明

位置:$JMete_Home/bin/jmeter.log
jmeter.log中,summariser日志格式如下:

2021-01-26 17:21:00,003 INFO o.a.j.r.Summariser: summary +  11464 in 00:01:49 =  105.0/s Avg:    94 Min:    25 Max:   711 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0
2021-01-26 17:24:00,002 INFO o.a.j.r.Summariser: summary +  19348 in 00:03:00 =  107.5/s Avg:    92 Min:    24 Max:  4515 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0
2021-01-26 17:24:00,003 INFO o.a.j.r.Summariser: summary =  30812 in 00:04:49 =  106.6/s Avg:    93 Min:    24 Max:  4515 Err:     0 (0.00%)
2021-01-26 17:27:00,010 INFO o.a.j.r.Summariser: summary +  20924 in 00:03:00 =  116.2/s Avg:    85 Min:    25 Max:   823 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0
2021-01-26 17:27:00,011 INFO o.a.j.r.Summariser: summary =  51736 in 00:07:49 =  110.3/s Avg:    90 Min:    24 Max:  4515 Err:     0 (0.00%)
2021-01-26 17:30:00,006 INFO o.a.j.r.Summariser: summary +  21737 in 00:03:00 =  120.8/s Avg:    82 Min:    24 Max:   789 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0
2021-01-26 17:30:00,007 INFO o.a.j.r.Summariser: summary =  73473 in 00:10:49 =  113.2/s Avg:    87 Min:    24 Max:  4515 Err:     0 (0.00%)
2021-01-26 17:33:00,010 INFO o.a.j
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值