Advertisement
Guest User

Tsung file for socket.io

a guest
Sep 5th, 2013
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.14 KB | None | 0 0
  1. ?xml version="1.0"?>
  2. <!DOCTYPE tsung SYSTEM "~/.tsung/tsung-1.0.dtd">
  3. <tsung loglevel="debug" version="1.0" dumptraffic="true">
  4.  
  5.   <!-- Client side setup -->
  6.   <clients>
  7.     <client host="localhost" use_controller_vm="true" maxusers="200" />
  8.   </clients>
  9.  
  10.   <!-- Server side setup -->
  11.   <servers>
  12.     <server host="site_url" port="80" type="tcp"></server>
  13.   </servers>
  14.  
  15.   <load>
  16.   <!-- several arrival phases can be set: for each phase, you can set
  17.  the mean inter-arrival time between new clients and the phase
  18.  duration -->
  19.     <arrivalphase phase="1" duration="100" unit="second">
  20.       <users interarrival="100" unit="second"></users>
  21.     </arrivalphase>
  22.   </load>
  23.  
  24.  
  25.   <!-- Additional testing options -->
  26.   <options>
  27.     <option name="websocket_path" value="/socket.io/1/websocket"/>
  28.  
  29.     <!-- How to distribute user-agents among Tsung sessions -->
  30.     <option type="ts_http" name="user_agent">
  31.       <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>
  32.       <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>
  33.     </option>
  34.   </options>
  35.  
  36.   <!-- start a session for a http user. the probability is the
  37.  frequency of this type os session. The sum of all session's
  38.  probabilities must be 100 -->
  39.  
  40.  <sessions>
  41.   <session name="activity_browse" probability="100" type="ts_http">
  42.  
  43.     <request>
  44.        <dyn_variable name="sid" re="\r\n\r\n([^:]+):[^:]+:[^:]+:[^:]+"/>
  45.        <http url="/socket.io/1/" method="POST" version="1.1" contents=""></http>
  46.     </request>
  47.  
  48.     <change_type new_type="ts_websocket" host="site_url" port="80" server_type="tcp" restore="true" store="true" />
  49.  
  50.     <request subst="true">
  51.        <websocket type="connect" path='/socket.io/1/websocket/%%_sid%%'></websocket>
  52.     </request>
  53.  
  54.     <thinktime value="2"/>
  55.  
  56.     <request>
  57.        <websocket type="message">5:1+::{"name":"first:event","args":[]}</websocket>
  58.     </request>
  59.  
  60.     <thinktime value="2"/>
  61.  
  62.     <request><websocket type="close"></websocket></request>
  63.  
  64.   </session>
  65.  </sessions>
  66. </tsung>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement