Performance Tool(2)Gatling SBT

本文介绍如何使用Gatling SBT插件进行性能测试项目的设置与运行,包括解决常见错误、配置SBT版本及运行模拟测试的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Performance Tool(2)Gatling SBT

1. Set up the Project gatling-sbt
>git clone https://github.com/gatling/gatling-sbt.git

Error Message:
Error during sbt execution: java.lang.IncompatibleClassChangeError: JLine incompatibility detected.  Check that the sbt launcher is version 0.13.x or later

Solution:
update my sbt version
>port install sbt
>sbt --version
sbt launcher version 0.13.0

It is not running right now. So I switch to another version of gatling-sbt from here https://github.com/krishnenc/gatling-sbt 

The latest version is 
https://github.com/excilys/gatling/wiki/Changelog#wiki-2.0.0-M3
https://github.com/excilys/gatling/wiki/Changelog#wiki-1.5.3
 
The sample codes are in easygatling. I am using the 1.5.3 version.

Based on the project easygatling, we can run it like this.
>sbt run

Then choose simulation

Or

>sbt compile
>export JAVA_OPTS="-XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms512M -Xmx512M -Xmn100M -Xss1024k -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly" 
>sbt stage
>target/start -s demo.SimulationTaobao

Actually, we can modify the target/start file and, we only need the jar file and results, userfiles directory.



References:
https://github.com/gatling/gatling-sbt
https://github.com/krishnenc/gatling-sbt

http://ska-la.blogspot.com/2012/07/gatling-tool-in-sbt-or-play-sample.html

https://github.com/excilys/gatling

https://github.com/sbt/sbt-assembly

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值