All Projects → youzan → Gatling Dubbo

youzan / Gatling Dubbo

A gatling plugin for running load tests on Apache Dubbo(https://github.com/apache/incubator-dubbo) and other java ecosystem.

Programming Languages

java
68154 projects - #9 most used programming language
scala
5932 projects

Projects that are alternatives of or similar to Gatling Dubbo

Web Tooling Benchmark
JavaScript benchmark for common web developer workloads
Stars: ✭ 290 (+121.37%)
Mutual labels:  performance, benchmark, benchmarking, performance-testing
Sysbench Docker Hpe
Sysbench Dockerfiles and Scripts for VM and Container benchmarking MySQL
Stars: ✭ 14 (-89.31%)
Mutual labels:  performance, benchmark, benchmarking, performance-testing
Ezfio
Simple NVME/SAS/SATA SSD test framework for Linux and Windows
Stars: ✭ 91 (-30.53%)
Mutual labels:  performance, benchmark, benchmarking
best
🏆 Delightful Benchmarking & Performance Testing
Stars: ✭ 73 (-44.27%)
Mutual labels:  benchmarking, benchmark, performance-testing
Phoronix Test Suite
The Phoronix Test Suite open-source, cross-platform automated testing/benchmarking software.
Stars: ✭ 1,339 (+922.14%)
Mutual labels:  performance, benchmark, benchmarking
mzbench
Distributed Benchmarking
Stars: ✭ 39 (-70.23%)
Mutual labels:  benchmarking, load-testing, performance-testing
load-testing-toolkit
Collection of open-source tools for debugging, benchmarking, load and stress testing your code or services.
Stars: ✭ 65 (-50.38%)
Mutual labels:  benchmarking, load-testing, performance-testing
Karma Benchmark
A Karma plugin to run Benchmark.js over multiple browsers with CI compatible output.
Stars: ✭ 88 (-32.82%)
Mutual labels:  performance, benchmark, benchmarking
Are We Fast Yet
Are We Fast Yet? Comparing Language Implementations with Objects, Closures, and Arrays
Stars: ✭ 161 (+22.9%)
Mutual labels:  performance, benchmark, benchmarking
Pytest Benchmark
py.test fixture for benchmarking code
Stars: ✭ 730 (+457.25%)
Mutual labels:  performance, benchmark, benchmarking
Boomer
A better load generator for locust, written in golang.
Stars: ✭ 734 (+460.31%)
Mutual labels:  performance, benchmark, performance-testing
Jsperf.com
jsperf.com v2. https://github.com/h5bp/lazyweb-requests/issues/174
Stars: ✭ 1,178 (+799.24%)
Mutual labels:  performance, benchmark, benchmarking
awesome-locust
A collection of resources covering different aspects of Locust load testing tool usage.
Stars: ✭ 40 (-69.47%)
Mutual labels:  benchmarking, load-testing, performance-testing
Phpbench
PHP Benchmarking framework
Stars: ✭ 1,235 (+842.75%)
Mutual labels:  performance, benchmarking, performance-testing
Bombardier
Fast cross-platform HTTP benchmarking tool written in Go
Stars: ✭ 2,952 (+2153.44%)
Mutual labels:  performance, benchmarking, load-testing
Performance Testing Framework
Framework allows to perform load testing with Apache Jmeter, view application/server metrics in real-time with Grafana, analyze errors cause with detailed traces for failed requests, compare different test runs in scripted dashboard and perform frontend performance testing with sitespeed.io+webpagetest
Stars: ✭ 275 (+109.92%)
Mutual labels:  performance, performance-testing, load-testing
Shadowreader
Serverless load testing for replaying website traffic. Powered by AWS Lambda.
Stars: ✭ 138 (+5.34%)
Mutual labels:  benchmarking, performance-testing, load-testing
Sltbench
C++ benchmark tool. Practical, stable and fast performance testing framework.
Stars: ✭ 137 (+4.58%)
Mutual labels:  performance, benchmark, benchmarking
Locust
Scalable user load testing tool written in Python
Stars: ✭ 17,763 (+13459.54%)
Mutual labels:  benchmarking, performance-testing, load-testing
Benchmarkdotnet
Powerful .NET library for benchmarking
Stars: ✭ 7,138 (+5348.85%)
Mutual labels:  performance, benchmark, benchmarking

Gatling-Dubbo 2.0

【招聘】Java开发、测试开发等岗位,有意者请将简历投递至<canyuns【@】163.com>

Gatling的非官方Dubbo压测插件,基于Gatling 2.3.1,插件已在Dubbo 2.6.5上测试,但理论上所有Dubbo版本都适用,2.0插件采用普通API调用方式执行压测请求,如果你想使用泛化调用方式执行压测请求,请参考1.0插件,推荐使用2.0插件,即采用普通API调用方式,因为 dubbo 官方推荐生产上使用该方式,所以以同样的方式压测得到的结果,更具有参考意义,且2.0插件无需 dubbo 框架做任何改造。

区别于 Gatling-Dubbo 1.0 只支持 dubbo 压测,Gatling-Dubbo 2.0 不仅支持 dubbo 压测,还支持非 dubbo 的其他 java 调用压测,因为脚本中的 f 怎么写控制权在你手里,就像使用 Jmeter 压测 java 一样。

使用方法

打包Jar

按需修改配置:

  • 默认为4核8G内存机器配置了200线程池,与dubbo线程池一致,你也可以根据自己的机器配置使用API调整线程池大小,下述
  • 如果你使用其他Dubbo版本,请修改根目录下build.sbt中的libraryDependencies配置

如果你不需要修改配置,可以略过以下打包步骤,直接下载Jar包(该 Jar 包无应用依赖)

项目依赖sbt,请安装sbt 1.2.1,详见官方文档,执行

$ git clone https://github.com/youzan/gatling-dubbo.git
$ cd gatling-dubbo
$ sbt assembly

将上述jar包拷贝到/your-path-to/gatling-charts-highcharts-bundle-2.3.1/lib目录

$ cp /your-path-to/gatling-dubbo/target/scala-2.12/gatling-dubbo-assembly-1.0.jar /your-path-to/gatling-charts-highcharts-bundle-2.3.1/lib

依赖

由于插件采用普通API调用方式执行压测请求,所以需要引入服务特定的 API 包,为了演示方便,这里直接将依赖写在了项目根目录下的 build.sbt 中:

name := "gatling-dubbo"

version := "1.0"

scalaVersion := "2.12.6"

libraryDependencies ++= Seq(
  "io.gatling" % "gatling-core" % "2.3.1" % "provided",
  "com.alibaba" % "dubbo" % "2.6.5",
  "com.youzan.xxx" % "xxx-api" % "1.xxx-RELEASE" exclude("ch.qos.logback", "logback-classic") //应用 API 包
)

assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)

创建Simulation和相应的json数据文件

参考gatling-dubbo/src/test/scala目录下的DubboTest.scala和data.json

DubboTest.scala具体说明请参考示例

check 说明
目前 check 支持两种,jsonPath 和 custom,如果 dubbo 返回值可以转化为 json(如 PlainResult、Map 等),则推荐使用 jsonPath 校验结果,如果 dubbo 返回值是 String 等类型,则推荐使用 custom 校验结果,即自定义校验逻辑,custom 的示例如下:

.check(custom((response: String) => {
              print(response)
              response == "expected response"
            }, "option error message"))

示例中展示的是单接口的例子,如果你想探测应用单机的真实水位,可以结合使用 gatling 的 randomSwitch 混合多接口且按生产环境真实的接口比例同时进行压测。

data.json

[
  {
    "kdtId": 160,
    "page": 1
  },
  {
    "kdtId": 160,
    "page": 2
  },
  {
    "kdtId": 160,
    "page": 3
  }
]

数据采用 json 数组保存,其中每一个 json 对象都是一次压测请求需要的完整参数,且为了方便通过 session 设置动态参数,数据结构采用一维结构,风格同 Jmeter。

执行Dubbo压测

$ bin/gatling.sh
GATLING_HOME is set to /your-path-to/gatling-charts-highcharts-bundle-2.3.1
Choose a simulation number:
     [0] dubbo.DubboTest
0
Select simulation id (default is 'dubbotest'). Accepted characters are a-z, A-Z, 0-9, - and _

Select run description (optional)

Simulation dubbo.DubboTest started...

================================================================================
2019-04-04 10:12:44                                           5s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=56     KO=0     )
> com.youzan.xxx.XxxService                                (OK=56     KO=0     )

---- scenario of xxx -----------------------------------------------------------
[--------------------------------------------------------------------------]  0%
          waiting: 0      / active: 10     / done:0
================================================================================

...

================================================================================
2019-04-04 10:13:11                                          31s elapsed
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=320    KO=0     )
> com.youzan.xxx.XxxService                                (OK=320    KO=0     )

---- scenario of xxx -----------------------------------------------------------
[--------------------------------------------------------------------------]  0%
          waiting: 0      / active: 10     / done:0
================================================================================

Simulation dubbo.DubboTest completed in 31 seconds
Parsing log file(s)...
Parsing log file(s) done
Generating reports...

================================================================================
---- Global Information --------------------------------------------------------
> request count                                        320 (OK=320    KO=0     )
> min response time                                     44 (OK=44     KO=-     )
> max response time                                    343 (OK=343    KO=-     )
> mean response time                                    62 (OK=62     KO=-     )
> std deviation                                         42 (OK=42     KO=-     )
> response time 50th percentile                         49 (OK=49     KO=-     )
> response time 75th percentile                         53 (OK=53     KO=-     )
> response time 95th percentile                        160 (OK=160    KO=-     )
> response time 99th percentile                        275 (OK=275    KO=-     )
> mean requests/sec                                 10.323 (OK=10.323 KO=-     )
---- Response Time Distribution ------------------------------------------------
> t < 800 ms                                           320 (100%)
> 800 ms < t < 1200 ms                                   0 (  0%)
> t > 1200 ms                                            0 (  0%)
> failed                                                 0 (  0%)
================================================================================

Reports generated in 0s.
Please open the following file: /your-path-to/gatling-charts-highcharts-bundle-2.3.1/results/dubbotest-1554343959840/index.html

打开上述报告查看更多压测信息: Reports

gatling-dubbo 在有赞的应用示例

I 应用基线性能评估与容量规划: Reports

II 中心化限流效果验证: Reports

License

Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].