Created
July 31, 2013 13:24
-
-
Save simong/6121940 to your computer and use it in GitHub Desktop.
A tsung XML file to benchmark Socket.IO servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <!DOCTYPE tsung SYSTEM "/opt/local/share/tsung/tsung-1.0.dtd" []> | |
| <tsung loglevel="notice" version="1.0" dumptraffic="true"> | |
| <!-- Each client that will be running Tsung during the test --> | |
| <clients> | |
| <client host="localhost" use_controller_vm="true" maxusers="1000" /> | |
| </clients> | |
| <!-- Each remote server that Tsung should performance test against. Only one would be needed if you have a load balancer. --> | |
| <servers> | |
| <server host="cam.oae.com" port="80" type="tcp" /> | |
| </servers> | |
| <!-- Describe how load will be ramped up to your application over time --> | |
| <load> | |
| <arrivalphase phase="1" duration="120" unit="second"> | |
| <users arrivalrate="4" unit="second" /> | |
| </arrivalphase> | |
| </load> | |
| <!-- Additional testing options --> | |
| <options> | |
| <option name="websocket_path" value="/socket.io/1/websocket"/> | |
| <!-- How to distribute user-agents among Tsung sessions --> | |
| <option type="ts_http" name="user_agent"> | |
| <user_agent probability="80">Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.21</user_agent> | |
| <user_agent probability="20">Mozilla/5.0 (Windows; U; Windows NT 5.2; fr-FR; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</user_agent> | |
| </option> | |
| </options> | |
| <sessions> | |
| <session name="activity_browse" probability="100" type="ts_http"> | |
| <!-- | |
| Perform a handshake with Socket.IO. | |
| This will return an ID which will uniquely identify this socket with Socket.IO | |
| --> | |
| <request> | |
| <dyn_variable name="websocket_session_id" re="(.*):60:60:websocket,htmlfile,xhr-polling,jsonp-polling" /> | |
| <http url="/socket.io/1/" method="POST" version="1.1" contents=""></http> | |
| </request> | |
| <!-- We need to change the session type to websocket --> | |
| <change_type new_type="ts_websocket" host="cam.oae.com" port="80" server_type="tcp" restore="true" store="true"/> | |
| <!-- Try to connect on a websocket --> | |
| <!-- See https://github.com/LearnBoost/socket.io-spec for more information --> | |
| <request subst="true"> | |
| <websocket type="connect" path="/socket.io/1/websocket/%%_websocket_session_id%%"></websocket> | |
| </request> | |
| <request> | |
| <websocket type="message">1::</websocket> | |
| </request> | |
| <!-- Do nothing for up to 5 seconds --> | |
| <thinktime value="5" random="true"/> | |
| <!-- State that we are interested in notifications (this is application specific).--> | |
| <request> | |
| <websocket type="message">4:1::{"name":"register-for-feed","args":{"feed": "oae.notifications", "resourceId": "u:cam:eVA584ZTI5", "signature": {"signature": "", "exipires": ""}}}</websocket> | |
| </request> | |
| <!-- Do nothing for up to 5 seconds --> | |
| <thinktime value="5" random="true"/> | |
| <!-- Close the socket --> | |
| <request> | |
| <websocket type="close"></websocket> | |
| </request> | |
| </session> | |
| </sessions> | |
| </tsung> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment