My question is about configuring my tsung.xml file to load-test chat application.
So, we have our MongooseIM server on the server side, jsjac.js library for our web-based client. We use xmpp and websockets to communicate.
httpbase for jsjac is looks like ws://hostname:5288/ws-xmpp/
and this part works fine for me. Tsung is supports websockets "from the box" and everybody says that the best way to test websockets - is to use tsung. But there is not so much information about how to do that.
Here is my tsung.xml:
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="10" />
</clients>
<servers>
<server host="hostname" port="5288" type="tcp" />
</servers>
<load>
<arrivalphase phase="1" duration="10" unit="second">
<users maxnumber="1" arrivalrate="1" unit="second" />
</arrivalphase>
</load>
<sessions>
<session name="websocket" probability="100" type="ts_websocket">
<request subst="true">
<websocket type="connect" path="/ws-xmpp"></websocket>
</request>
<request>
<dyn_variable name="uid" jsonpath="uid"/>
<websocket type="message">{"user":"bob", "password":"bob"}</websocket>
</request>
<request subst="true">
<match do="log" when="nomatch">ok</match>
<websocket type="message">{"uid":"%%_uid%%", "data":"data"}</websocket>
</request>
<request>
<websocket type ="message">{"key":"value"}</websocket>
</request>
<request>
<websocket type="close"></websocket>
</request>
</session>
</sessions>
</tsung>
and after test passed the result is:
connected: 0
finish_users_count: 1
users: 1
users count: 1
websocket_succ: 1
user "bob" is really exist in server's db and works fine via client application.
Can anybody tell me what i'm doing wrong?
Or maybe someone could provide a link to some article or working xml file?
Thanks.
There was a couple of things to do... so,first of all, BIG THANKS to Piotr! his response (+ jabber scenario example) has helped to solve my problem
here is my working tsung.xml
with this tsung is generates 20 users (user001 - user0020) and i can see them all in my "bob's" roster. I use a Spark IM client to monitor this.