jsr223 java_JMeter脚本的Beanshell和JSR223和Java原生请求的对比

前言

结合之前一篇介绍JMeter测试Kafka的文章,遇到了JSR223,Beanshell等概念,这篇文章有讲解,转帖出来。

正文

Beanshell vs JSR223 vs Java JMeter Scripting: The Performance-Off You've Been Waiting For!

There are several options to perform custom JMeter scripting and extend baseline JMeter functionality. Check out the most popular extension mechanisms, compare performance and analyze which one is the best.

It's Battle of the Bands, JMeter style.

Beanshell V. JSR223 V. Java Request Sampler

In our previous post,  JMeter Performance and Tuning Tips (written by the fantastik Philipe Mouwad) we recommended using  JSR 223 + Groovy for Scripting. It’s the best option as Groovy scripts can be compiled into native Java code (assuming some requirements are met) so Groovy script execution performance can be almost as fast as Java code.

Groovy脚本是一个进行测试很好的选择,因为它可以被编译成原生的Java代码,它执行效率可以和Java代码一样快。

So if you’re about to use scripts for something once, quick 'n dirty (e.g. reading configuration files at the beginning of the test) you’re welcome to use Beanshell/Javascript/whatever you’re comfortable with.

如果你只是想要使用脚本做一次什么事情,quick 'n dirty是啥意思,例如在测试开始时读取配置,你可以使用任何脚本。

But, if you’re about to do some extensive load testing through scripting (i.e. constructing massive HTTP requests from calculated data) you need to consider either Groovy or custom Java requests or a JMeter Sampler.

但是,如果您要通过脚本进行一些广泛的负载测试(即从计算数据构建大量HTTP请求),则需要考虑Groovy或自定义Java请求或JMeter Sampler。

For comparison purposes, we’re going to use the same simple code which generates a 1Mb string of r

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值