Sharing data between scenarios

756 views
Skip to first unread message

Niklas Modin

unread,
Aug 14, 2015, 8:50:15 AM8/14/15
to Gatling User Group
Hi all,

I'm setting up a simulation which basically is a set of users talking to each other over a web socket service (WebRTC).
One set of users are the callers, and the other set are the callees. An analogy would be a group of SIP users setting
up connections between themselves.

My idea here is to start one scenarion where the callees are connecting and then waiting for invites from the callers as 
incoming json request on the web socket. The callers will connect and send the json request to the ws service, which
in turn will relay these to the callees web sockets.

In order for the callers to send the json request I need to extract data from the callees connect response message from 
the web socket service and save this into some data structure (e.g a fifo list/stack) which the callers can access and retrieve data
from. It is basically the "phone number" the callees are assigned at connect that the callers will use in their scenario.


My first question here is whether this general plan sounds ok ? :)

Secondly how would I go about to go from .saveAs on the web socket response to storing this in something that the other
scenario can reach rather than just storing it in the User session ? Ideally the caller user scenario would wait/pause until there
is an entry in this data structure before popping the fifo-list and proceed with the call setup.

Are there any examples out there where 2 scenarios share data ?

If this isn't feasible my second idea was to have a feeder containing all callee "phone numbers", however this could be
a very large set (e.g 500K) of users and from what I've understood this would eat a lot of heap.

Let me know if you want more info and/or snippets etc.

Cheers,
Niklas


Stéphane LANDELLE

unread,
Sep 3, 2015, 8:29:00 AM9/3/15
to gat...@googlegroups.com
You have to store the shared data into some thread-safe structure, such as a ConcurrentHashMap.

Stéphane Landelle
Lead developer


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Niklas Modin

unread,
Sep 3, 2015, 8:49:50 AM9/3/15
to gat...@googlegroups.com, gat...@googlegroups.com
Hi,

Yep, I fixed it with a Queue. :)

Maybe some defined way of sharing state between scenarios could be a (low priority) feature in the future ? Or just an example solution to the docs where multiple scenarios are discussed.

Niklas


Sent from Mailbox


You received this message because you are subscribed to a topic in the Google Groups "Gatling User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gatling/KE8xCwVVEL4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gatling+u...@googlegroups.com.

Reetu Pandita

unread,
Dec 12, 2017, 4:54:51 AM12/12/17
to Gatling User Group
Hi Niklas/ Stéphane,

Could you please share the example where you are sharing data between two Gatling scenarios. I am having a similar situation where I need to pass a map and two strings to other scenario. But I am not able to come up with a solution. Any help, would be highly appreciated
Reply all
Reply to author
Forward
0 new messages