加特林(Gatling):在几秒钟内了解rampUsersPerSec(minTPS)到maxTPS

时间:2019-06-14 08:45:13

标签: scala gatling

我正在检查一个scala代码,以确认他们在20秒钟内注入交易的地方。

/*TPS = Transaction Per Second */   
  val minTps = Integer.parseInt(System.getProperty("minTps", "1"))
  val maxTps = Integer.parseInt(System.getProperty("maxTps", "5"))

  var rampUsersDurationInMinutes =Integer.parseInt(System.getProperty("rampUsersDurationInMinutes", "20"))
  setUp(scn.inject(
    rampUsersPerSec(minTps) to maxTps during (rampUsersDurationInMinutes seconds)).protocols(tcilProtocol))

有人问What does rampUsersPerSec function really do?,但从未回答过同样的问题。我认为图形 理想 应该看起来像那样。

  

请确认我是否正确理解    rampUsersPerSec

enter image description here

  • 阻止(斜坡)1 = 4个用户+1
  • 阻止(斜坡)2 = 12个用户+2
  • 阻止(升级)3 = 24个用户+3
  • 阻止(升级)4 = 40个用户+4
  • 阻止(升级)5 = 60个用户+5

结果表明请求数确实为60。我的计算正确吗?

---- Global Information --------------------------------------------------------
> request count                                         60 (OK=38     KO=22    )
> min response time                                   2569 (OK=2569   KO=60080 )
> max response time                                  61980 (OK=61980  KO=61770 )
> mean response time                                 42888 (OK=32411  KO=60985 )
> std deviation                                      20365 (OK=18850  KO=505   )
> response time 50th percentile                      51666 (OK=32143  KO=61026 )
> response time 75th percentile                      60903 (OK=48508  KO=61371 )
> response time 95th percentile                      61775 (OK=61886  KO=61725 )
> response time 99th percentile                      61974 (OK=61976  KO=61762 )
> mean requests/sec                                  0.741 (OK=0.469  KO=0.272 )
---- Response Time Distribution ------------------------------------------------

enter image description here

1 个答案:

答案 0 :(得分:5)

rampUsersPerSec是一个开放的工作负载模型注入,您可以在其中指定用户启动方案的速率。 gatling documentation表示此注入配置文件

  

在给定的持续时间内,将用户从起始速率注入到目标速率(以每秒用户数定义)。将定期注入用户

因此,尽管我不确定您所提供的示例是否正确,因为加特林机使用的是“常规间隔”(可能是更平滑的模型),所以您或多或少是正确的。您指定起始速率和最终速率,加特林系统计算出您持续时间内的所有中间注入速率。

请注意,这并没有说明您的模拟将生成的并发用户数量-这是到达率(由您控制​​)和执行时间(不受控制)的函数