maven gatling 运行
来源:互联网 发布:哥贝克力 知乎 编辑:程序博客网 时间:2024/06/05 17:54
pom.xml
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>demofor</groupId> <artifactId>demofor</artifactId> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>io.gatling.highcharts</groupId> <artifactId>gatling-charts-highcharts</artifactId> <version>2.2.4</version> </dependency> </dependencies> <build> <plugins> <plugin> <!-- Run all [matching] tests] on mvn test --> <groupId>io.gatling</groupId> <artifactId>gatling-maven-plugin</artifactId> <version>2.2.4</version> <configuration> <simulationsFolder>${user.dir}/src/main/java</simulationsFolder> <!--<includes>--> <!--<include>com.jane.DemoOne</include>--> <!--</includes>--> <!--<excludes>--> <!--<exclude>Demo.scala</exclude>--> <!--</excludes>--> <simulationClass>com.jane.DemoOne</simulationClass> </configuration> <executions> <execution> <phase>test</phase> <goals> <goal>execute</goal> </goals> <configuration> <jvmArgs> <jvmArg>-Dgatling.http.ahc.connectTimeout=6000000</jvmArg> <jvmArg>-Dgatling.http.ahc.requestTimeout=6000000</jvmArg> <jvmArg>-Dgatling.http.ahc.sslSessionTimeout=6000000</jvmArg> <jvmArg>-Dgatling.http.ahc.pooledConnectionIdleTimeout=6000000</jvmArg> <jvmArg>-Dgatling.http.ahc.readTimeout=6000000</jvmArg> </jvmArgs> </configuration> </execution> </executions> </plugin> </plugins> </build></project>
import io.gatling.core.Predef._import io.gatling.http.Predef._import scala.concurrent.duration._class Demo extends Simulation{ val httpProtocol = http .baseURL("your-url") .inferHtmlResources() .acceptHeader("image/webp,image/*,*/*;q=0.8") .acceptEncodingHeader("gzip, deflate, sdch") .acceptLanguageHeader("zh-CN,zh;q=0.8") .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36") val header_1 = Map("Accept" -> "*/*") var scn = scenario("Demo").exec(http("request_0").get("your-interface")) setUp(scn.inject(rampUsers(10) over(5 seconds))).protocols(httpProtocol)}
运行方式:
mvn test
阅读全文
0 0
- maven gatling 运行
- maven运行
- gatling详细使用
- 压测工具 Gatling
- 什麽是gatling ? Gatling, the Java ME Test Framework.
- gatling、scala、svn 测试案例
- 性能测试工具Gatling介绍
- gatling模拟线上实际压力
- gatling java内存溢出解决方法
- 运行maven项目三部曲
- maven与jetty运行
- 安装和运行maven
- maven运行testNG
- maven 中运行ant
- 安装和运行Maven
- 运行Maven工具
- maven项目打包运行
- Maven 运行命令
- Java
- 工厂模式区别
- git 删除本地追踪远程仓库但远程仓库已经不存在的分支
- 基于pyspider的大众点评数据爬取总结
- 网络图片加载
- maven gatling 运行
- Kafka集群动态修改复制因子以及数据留存时间
- oracle密码重置
- Spring 整合JDBCTemplate
- 桥接模式(Bridge)(对象结构型模式)
- 闭包为何可实现变量持久性
- 手机突然没信号!伪基站究竟是怎样搞鬼的?
- 浅谈js中 call, apply, bind 的区别
- tensorflow中tf.app.run()的含义