PageRenderTime 182ms CodeModel.GetById 121ms app.highlight 0ms RepoModel.GetById 60ms app.codeStats 0ms

/benchmarks/scenarii/templates/connect_and_listen.erb

http://github.com/AF83/ucengine
ERB | 31 lines | 26 code | 5 blank | 0 comment | 0 complexity | 940c9035e8cc8862172b94f9574e30a6 MD5 | raw file
 1<setdynvars sourcetype="file" fileid="users" delimiter=";" order="iter">
 2  <var name="meeting" />
 3  <var name="username" />
 4  <var name="password" />
 5</setdynvars>
 6
 7  <!-- Authenticate -->
 8  <request subst="true">
 9    <dyn_variable name="sid" jsonpath="result.sid" />
10    <dyn_variable name="uid" jsonpath="result.uid" />
11    <http url='/api/0.6/presence' contents='name=%%_username%%&amp;auth=password&amp;credential=%%_password%%' method='POST' />
12  </request>
13
14  <request subst="true">
15    <dyn_variable name="events" jsonpath="result"/>
16    <http url='/api/0.6/event/%%_meeting%%?uid=%%_uid%%&amp;sid=%%_sid%%&amp;start=0&amp;count=1&amp;order=desc' method='GET' />
17  </request>
18
19  <setdynvars sourcetype="erlang" callback="tsung_utils:extract_last_timestamp">
20    <var name="last" />
21  </setdynvars>
22  <!-- Main Loop -->
23  <for var="pending_counter" from="1" to="5000">
24
25    <!-- Wait for events -->
26      <request subst="true">
27        <dyn_variable name="events" jsonpath="result"/>
28        <http url='/api/0.6/live/%%_meeting%%?uid=%%_uid%%&amp;sid=%%_sid%%&amp;start=%%_last%%&amp;mode=longpolling' method='GET' />
29      </request>
30
31  </for>