0a52712258
Refs EventHub/EventHubBack#30 [skip ci] Co-authored-by: Cursor <cursoragent@cursor.com>
141 lines
6.7 KiB
XML
141 lines
6.7 KiB
XML
<?xml version="1.0"?>
|
|
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
|
|
<!--
|
|
IFT controlled hold, maxusers=150 (next ceiling after 100).
|
|
Pool: ift-users.csv. Mix browse 70% / write 30%.
|
|
use_controller_vm; ladder 0.2->0.1->0.05->0.035; hold >=2 min.
|
|
Caution on IFT/WSL (200 previously wedged host). Criterion 2A: error >1% OR mean >500 ms.
|
|
-->
|
|
<tsung loglevel="notice" version="1.0">
|
|
<clients>
|
|
<client host="localhost" use_controller_vm="true" maxusers="150"/>
|
|
</clients>
|
|
|
|
<servers>
|
|
<server host="api.ift.eventhub.local" port="443" type="ssl"/>
|
|
</servers>
|
|
|
|
<load>
|
|
<arrivalphase phase="1" duration="2" unit="minute">
|
|
<users interarrival="0.2" unit="second"/>
|
|
</arrivalphase>
|
|
<arrivalphase phase="2" duration="2" unit="minute">
|
|
<users interarrival="0.1" unit="second"/>
|
|
</arrivalphase>
|
|
<arrivalphase phase="3" duration="3" unit="minute">
|
|
<users interarrival="0.05" unit="second"/>
|
|
</arrivalphase>
|
|
<arrivalphase phase="4" duration="3" unit="minute">
|
|
<users interarrival="0.035" unit="second"/>
|
|
</arrivalphase>
|
|
</load>
|
|
|
|
<options>
|
|
<option name="ssl_reuse" value="true"/>
|
|
<option name="file_server" id="usercred" value="test/tsung/ift-users.csv"/>
|
|
</options>
|
|
|
|
<sessions>
|
|
<session name="browse" probability="70" type="ts_http">
|
|
<setdynvars sourcetype="file" fileid="usercred" delimiter=";" order="iter">
|
|
<var name="user_email"/>
|
|
<var name="user_password"/>
|
|
</setdynvars>
|
|
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<dyn_variable name="token" re=""token"\s*:\s*"([^"]+)"/>
|
|
<http url="https://api.ift.eventhub.local/v1/login" method="POST" version="1.1"
|
|
content_type="application/json"
|
|
contents='{"email":"%%_user_email%%","password":"%%_user_password%%"}'/>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<http url="https://api.ift.eventhub.local/v1/user/me" method="GET" version="1.1">
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<http url="https://api.ift.eventhub.local/v1/calendars" method="GET" version="1.1">
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="log" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<http url="https://api.ift.eventhub.local/v1/search?q=lt" method="GET" version="1.1">
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="log" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<http url="https://api.ift.eventhub.local/v1/user/bookings" method="GET" version="1.1">
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
</session>
|
|
|
|
<session name="write" probability="30" type="ts_http">
|
|
<setdynvars sourcetype="file" fileid="usercred" delimiter=";" order="iter">
|
|
<var name="user_email"/>
|
|
<var name="user_password"/>
|
|
</setdynvars>
|
|
<setdynvars sourcetype="random_number" start="100000" end="9999999">
|
|
<var name="rand_id"/>
|
|
</setdynvars>
|
|
<setdynvars sourcetype="random_number" start="10" end="28">
|
|
<var name="day"/>
|
|
</setdynvars>
|
|
<setdynvars sourcetype="random_number" start="10" end="59">
|
|
<var name="sec"/>
|
|
</setdynvars>
|
|
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<dyn_variable name="token" re=""token"\s*:\s*"([^"]+)"/>
|
|
<http url="https://api.ift.eventhub.local/v1/login" method="POST" version="1.1"
|
|
content_type="application/json"
|
|
contents='{"email":"%%_user_email%%","password":"%%_user_password%%"}'/>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<dyn_variable name="calendar_id" re=""id"\s*:\s*"([^"]+)"/>
|
|
<http url="https://api.ift.eventhub.local/v1/calendars" method="POST" version="1.1"
|
|
content_type="application/json"
|
|
contents='{"title":"Stress Cal %%_rand_id%%","confirmation":"auto"}'>
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<dyn_variable name="event_id" re=""id"\s*:\s*"([^"]+)"/>
|
|
<http url="https://api.ift.eventhub.local/v1/calendars/%%_calendar_id%%/events" method="POST"
|
|
version="1.1" content_type="application/json"
|
|
contents='{"title":"Stress Ev %%_rand_id%%","start_time":"2032-08-%%_day%%T14:00:%%_sec%%Z","duration":30,"capacity":20}'>
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="abort" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<http url="https://api.ift.eventhub.local/v1/events/%%_event_id%%" method="GET" version="1.1">
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
<thinktime value="1"/>
|
|
<request subst="true">
|
|
<match do="log" when="nomatch">HTTP/[0-9.]+ 20</match>
|
|
<http url="https://api.ift.eventhub.local/v1/calendars" method="GET" version="1.1">
|
|
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
|
</http>
|
|
</request>
|
|
</session>
|
|
</sessions>
|
|
</tsung>
|