Files
EventHubBack/test/tsung/eventhub_http.xml

64 lines
2.8 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
<clients>
<client host="localhost" use_controller_vm="true" maxusers="1000"/>
</clients>
<servers>
<server host="localhost" port="8080" type="tcp"/>
</servers>
<load>
<arrivalphase phase="1" duration="2" unit="minute">
<users interarrival="0.1" unit="second"/>
</arrivalphase>
</load>
<sessions>
<session name="eventhub_user" probability="100" type="ts_http">
<!-- 1. Регистрация -->
<request>
<dyn_variable name="token" re="&quot;token&quot;:&quot;(.+?)&quot;"/>
<http url="/v1/register" method="POST" content_type="application/json"
contents="{\&quot;email\&quot;: \&quot;loadtest_%%_ts_userid:server:ts_userid%%@example.com\&quot;, \&quot;password\&quot;: \&quot;testpassword123\&quot;}"/>
</request>
<!-- 2. Создание календаря -->
<request>
<dyn_variable name="calendar_id" re="&quot;id&quot;:&quot;(.+?)&quot;"/>
<http url="/v1/calendars" method="POST" content_type="application/json"
contents="{\&quot;title\&quot;: \&quot;Load Test Calendar\&quot;, \&quot;description\&quot;: \&quot;Tsung test\&quot;}">
<http_header name="Authorization" value="Bearer %%_token%%"/>
</http>
</request>
<!-- 3. Создание события -->
<request>
<dyn_variable name="event_id" re="&quot;id&quot;:&quot;(.+?)&quot;"/>
<http url="/v1/calendars/%%_calendar_id%%/events" method="POST" content_type="application/json"
contents="{\&quot;title\&quot;:\&quot;Tsung Event\&quot;,\&quot;start_time\&quot;:\&quot;2027-01-01T10:00:00Z\&quot;,\&quot;duration\&quot;:60,\&quot;capacity\&quot;:100}">
<http_header name="Authorization" value="Bearer %%_token%%"/>
</http>
</request>
<!-- 4. Запись на событие -->
<request>
<http url="/v1/events/%%_event_id%%/bookings" method="POST" content_type="application/json"
contents="{}">
<http_header name="Authorization" value="Bearer %%_token%%"/>
</http>
</request>
<!-- 5. Поиск -->
<request>
<http url="/v1/search?type=event&amp;q=Tsung" method="GET">
<http_header name="Authorization" value="Bearer %%_token%%"/>
</http>
</request>
<thinktime min="1" max="5" random="true"/>
</session>
</sessions>
</tsung>