gatling

How to pass a session variable from one object to another in Gatling?

别说谁变了你拦得住时间么 提交于 2019-12-04 14:51:49
I'm extracting session variable in ObjectA and would like to pass it to ObjectB, what is the best way to achieve this? object ObjectA { val foo = exec(jsfPost("Request1", "/something.xhtml") .formParam("SUBMIT", "1") .check(regex("""Count:([^:]*),""").saveAs("Count")) ) .pause(1) .exec { session => val Count = session("Count").as[String].toInt val GroupName = SomeCustomFunc(Count) } .exec(ObjectB.bar) } object ObjectB{ val bar = group(GroupName){ myChain } } Pretty sure I'll feel stupid after seeing the answer, but so far did not managed to get this working. Answer: As Stephane suggested

Why increasing worker_connections in Nginx makes the application slower in node.js cluster?

爱⌒轻易说出口 提交于 2019-12-04 14:04:06
I'm transforming my application to node.js cluster which I hope it would boost the performance of my application. Currently, I'm deploying the application to 2 EC2 t2.medium instances. I have Nginx as a proxy and ELB. This is my express cluster application which is pretty standard from the documentation. var bodyParser = require('body-parser'); var cors = require('cors'); var cluster = require('cluster'); var debug = require('debug')('expressapp'); if(cluster.isMaster) { var numWorkers = require('os').cpus().length; debug('Master cluster setting up ' + numWorkers + ' workers'); for(var i = 0;

Stateful checks in gatling websocket scenario

我怕爱的太早我们不能终老 提交于 2019-12-04 09:20:06
I have a gatling scenario where I subscribe to a websocket and want to check the incoming messages for internal consistency. E.g. the messages coming over the websocket are <user>: <sequence number> , and I want to check that for each user string, the sequence number is continuous and increasing from 1. a: 1 b: 1 a: 2 b: 2 a: 1 // <= this would be an error because last a was 2, so should be 3 My first approach was to store something like a Map[String, Int] in a session variable. But it seems to me that the gatling webservice API does not allow storing non-string session variables: This (just

ssl - Error self signed certificate getting chain

拟墨画扇 提交于 2019-12-04 05:52:50
I'm learning to use Gatling to test scenario I've been doing with guide from documentation here http://gatling.io/docs/2.1.7/http/recorder.html Because my to-be-tested scenario includes logging in with Google Account, it is rejected due to lack of certificate. I followed guidelines to generate a certificate openssl genrsa -out rootCA.key 2048 openssl req -x509 -new -nodes -key rootCA.key -days 1 -out rootCA.pem openssl x509 -outform der -in rootCA.pem -out gatlingCA.crt openssl genrsa -out device.key 2048 openssl req -new -key device.key -out device.csr openssl x509 -req -in device.csr -CA

How to add random value in Json Body in Gatling?

房东的猫 提交于 2019-12-03 10:57:11
I need to create a random positive integer each time and send it to Json body in Gatling. I used the below code to create a random positive ineger: val r = new scala.util.Random; val OrderRef = r.nextInt(Integer.MAX_VALUE); but, How can I feed the randomly generated value into the json body? I tried: .exec(http("OrderCreation") .post("/abc/orders") .body(StringBody("""{ "orderReference": "${OrderRef}"}""").asJson) But, this doesn't seem to work. Any clues please. Thanks! Teliatko First of all you want to generate random number each time, thus OrderRef has to be a method, like: def orderRef() =

Build executable JAR for Gatling load test

北慕城南 提交于 2019-12-03 10:38:12
I am new to Gatling (2.1.2) and want to do a small prototype project to show to my colleagues. According to the quick start page, there are several ways I can run a simulation with Gatling: decompress the Gatling bundle into a folder and drop my simulation files into user-files/simulations folder. bin/gatling.sh will compile and run the simulation files. use the gatling-maven-plugin maven plugin to execute the simulation. create a project with gatling-highcharts-maven-archetype , and run the Engine class. and I found those problems For 1, it is hard to add dependencies for simulation classes.

Parsing a Json response returned to Gatling

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to parse a json response returned to gatling by the server. My response from server is: SessionAttribute( Session( GetServices, 3491823964710285818-0, Map( gatling.http.cache.etagStore -> Map(https://api.xyz.com/services -> ), gatling.http.cache.lastModifiedStore -> Map(https://api.xyz.com/services -> ), myresponse -> { "created":"2014-12-16T22:06:59.149+0000", "id":"x8utwb2unq8uey23vpj64t65", "name":"myservice", "updated":"2014-12-16T22:06:59.149+0000", "version":null }), 1418767654142,622, OK,List(),<function1>),id) I am doing

使用 Gateling 进行性能测试

一笑奈何 提交于 2019-12-02 21:47:22
Gatling 是一个简便的性能测试工具,用它编写性能测试脚本速度快易上手。本文将深入探究 Gatling 的功能以及如何更好地使用。 在程序部署到生产环境前,有多少人会创建自动化性能测试?通常,开发人员更重视功能测试,至少会进行一些简单的单元测试和集成测试。但是与未检测到的业务错误相比,有时候性能泄露造成的问题更严重。因为后者会影响整个系统,不仅仅是某个业务流程。 就个人而言,我一直对自己开发的程序进行性能测试,但是从来没有把它作为持续集成的一部分运行。当然,这是几年前的情况,那时候我的知识和经验都略显不足。最近,我开始对性能测试相关的主题非常感兴趣,部分原因是公司的应用程序存在性能问题。问题的关键是找到合适的工具。也许很多人听说过 JMeter,这里会介绍它的竞品——Gatling。它会生成各种内容丰富的报告,其中包含了测试用例执行过程中收集的所有指标。这些功能比 JMeter 似乎更好。 在开始介绍 Gatling 之前,让我们先聊聊理论。首先,性能测试有两种类型:负载测试和压力测试。负载测试会验证,在特定时间内有大量客户端同时发起请求情况下的系统功能。这种测试的主要目标是模拟生产环境中可能出现的流量。压力测试会执行负载测试,把应用程序推向极限,查看重负载情况下程序的表现。 Gatling是什么? Gatling 是一个用 Scala 编写的负载测试工具,功能强大。它完全支持

Gatling.io share data between virtual users

旧时模样 提交于 2019-12-02 07:16:15
问题 I'm using Gatling.io to test a website. I have a scenario with multiple virtual users. val users = scenario("Users").exec(Session.browse) val admins = scenario("Admins").exec(Session.create) I want the admin user to create a "session" on the website I'm testing, save the session name from the result returned by the website, and have the other users to visit the session previously created by getting the session name from the user admin. How can I share the session name between users ? 回答1: I

Gatling.io share data between virtual users

旧城冷巷雨未停 提交于 2019-12-02 06:01:31
I'm using Gatling.io to test a website. I have a scenario with multiple virtual users. val users = scenario("Users").exec(Session.browse) val admins = scenario("Admins").exec(Session.create) I want the admin user to create a "session" on the website I'm testing, save the session name from the result returned by the website, and have the other users to visit the session previously created by getting the session name from the user admin. How can I share the session name between users ? James Warr I think the default Gatling answer for this is to create the session and persist it in a file of