ngrinder压力测试

另一篇

https://blog.csdn.net/dataiyangu/article/details/88851898

部署demo

在机器上部署自己的用于测试的demo,我就是直接在tomcat下安装的

写脚本

通过书写grovy脚本访问自己的demo。
将写好的grovy脚本上传拿到ngrinder
在这里插入图片描述

压力测试

在这里插入图片描述
脚本:指向刚才的脚本,通过这个脚本不断的去访问自己的demo
目标主机:即自己刚才部署的demo的机器ip
如此便关联起来了

目标主机监控

在目标主机上同样需要一个监控的脚本
最后生成监控的日志
具体脚本是机密。

可能报错

java.net.ConnectException: Connection refused (Connection refused)
	at HTTPClient.HTTPConnection$EstablishConnection.run(HTTPConnection.java:4082) ~[grinder-httpclient-3.9.1.jar:na]
2019-05-06 18:25:32,124 INFO  shut down
2019-05-06 18:25:32,124 INFO  finished 1011 runs
2019-05-06 18:25:32,124 INFO  shut down
2019-05-06 18:25:32,124 INFO  finished 1015 runs
2019-05-06 18:25:32,124 ERROR Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
	at HTTPClient.HTTPConnection$EstablishConnection.run(HTTPConnection.java:4082) ~[grinder-httpclient-3.9.1.jar:na]
2019-05-06 18:25:32,124 ERROR Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
	at HTTPClient.HTTPConnection$EstablishConnection.run(HTTPConnection.java:4082) ~[grinder-httpclient-3.9.1.jar:na]
2019-05-06 18:25:32,124 INFO  shut down
2019-05-06 18:25:32,124 INFO  finished 1030 runs
2019-05-06 18:25:32,124 INFO  shut down
2019-05-06 18:25:32,124 INFO  finished 1020 runs
2019-05-06 18:25:32,125 ERROR Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
	at HTTPClient.HTTPConnection$EstablishConnection.run(HTTPConnection.java:4082) ~[grinder-httpclient-3.9.1.jar:na]
2019-05-06 18:25:32,125 INFO  shut down
2019-05-06 18:25:32,125 INFO  finished 1035 runs
2019-05-06 18:25:32,130 ERROR Connection refused (Connection refused)
java.net.ConnectException: Connection refused (Connection refused)
	at HTTPClient.HTTPConnection$EstablishConnection.run(HTTPConnection.java:4082) ~[grinder-httpclient-3.9.1.jar:na]
2019-05-06 18:25:32,130 INFO  shut down
2019-05-06 18:25:32,130 INFO  finished 1014 runs
2019-05-06 18:25:32,136 INFO  elapsed time is 13916 ms
2019-05-06 18:25:32,136 INFO  Final statistics for this process:
2019-05-06 18:25:32,145 INFO  
             Tests        Errors       Mean Test    Test Time    TPS          Mean         Response     Response     Mean time to Mean time to Mean time to 
                                       Time (ms)    Standard                  response     bytes per    errors       resolve host establish    first byte   
                                                    Deviation                 length       second                                 connection                
                                                    (ms)                                                                                                    

Test 1       0            256220.00         0.000.00         0            �            �            �             "Test_SelfDemo"

Totals       0            256220.00         0.000.00         0            �            �            �            

运行压力测试的时候报错如上,Connection refused,就是我的tomcat长时间没有动它,自己挂掉了,所以Connection refused,郁闷。

总结:

ngrinder的作用就是主要用来不断的发送请求的(搭配上脚本效果更好),当然在最后测试完成的时候也会有监控的信息,但是粒度比较粗,也能满足需求,而我们目标主机上的脚本就是专门用来监控请求时候的主机cpu 等信息的,当然数据库的主机也可以来一份监控脚本,做一个辅助的判断功能。

转载于:https://www.cnblogs.com/LeesinDong/p/10835252.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值