docs(loadtest): hold/stress профили и правила безопасности IFT. Refs EventHub/EventHubBack#31 [skip ci]
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
|
||||
<!--
|
||||
IFT stress (hot path): поиск верхней границы.
|
||||
Пул: test/tsung/ift-users.csv (seed-ift-users.sh).
|
||||
Mix: browse 70% / write 30%. Без admin/register/verify на VU.
|
||||
Стоп (анализ после прогона): error rate >1% ИЛИ mean request >500 ms на hold.
|
||||
thinktime отключён (Tsung: min=0 и дробные max недопустимы). Все URL абсолютные.
|
||||
-->
|
||||
<tsung loglevel="notice" version="1.0">
|
||||
<clients>
|
||||
<client host="localhost" use_controller_vm="true" maxusers="800"/>
|
||||
</clients>
|
||||
|
||||
<servers>
|
||||
<server host="api.ift.eventhub.local" port="443" type="ssl"/>
|
||||
</servers>
|
||||
|
||||
<load>
|
||||
<!--
|
||||
Прогон 20260715-1027 с interarrival 0.05→0.006 и maxusers=5000
|
||||
дал BOUNDARY_HIT (mean~735ms, ~88% transport errors) и заклинил SSH на IFT.
|
||||
Текущий ladder мягче; maxusers ограничен, чтобы клиент не копил тысячи hung VU.
|
||||
-->
|
||||
<arrivalphase phase="1" duration="2" unit="minute">
|
||||
<users interarrival="0.1" unit="second"/>
|
||||
</arrivalphase>
|
||||
<arrivalphase phase="2" duration="2" unit="minute">
|
||||
<users interarrival="0.05" unit="second"/>
|
||||
</arrivalphase>
|
||||
<arrivalphase phase="3" duration="2" unit="minute">
|
||||
<users interarrival="0.025" unit="second"/>
|
||||
</arrivalphase>
|
||||
<arrivalphase phase="4" duration="3" unit="minute">
|
||||
<users interarrival="0.012" 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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user