Load tests
This commit is contained in:
64
test/tsung/eventhub_http.xml
Normal file
64
test/tsung/eventhub_http.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?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=""token":"(.+?)""/>
|
||||
<http url="/v1/register" method="POST" content_type="application/json"
|
||||
contents="{\"email\": \"loadtest_%%_ts_userid:server:ts_userid%%@example.com\", \"password\": \"testpassword123\"}"/>
|
||||
</request>
|
||||
|
||||
<!-- 2. Создание календаря -->
|
||||
<request>
|
||||
<dyn_variable name="calendar_id" re=""id":"(.+?)""/>
|
||||
<http url="/v1/calendars" method="POST" content_type="application/json"
|
||||
contents="{\"title\": \"Load Test Calendar\", \"description\": \"Tsung test\"}">
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
</request>
|
||||
|
||||
<!-- 3. Создание события -->
|
||||
<request>
|
||||
<dyn_variable name="event_id" re=""id":"(.+?)""/>
|
||||
<http url="/v1/calendars/%%_calendar_id%%/events" method="POST" content_type="application/json"
|
||||
contents="{\"title\":\"Tsung Event\",\"start_time\":\"2027-01-01T10:00:00Z\",\"duration\":60,\"capacity\":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&q=Tsung" method="GET">
|
||||
<http_header name="Authorization" value="Bearer %%_token%%"/>
|
||||
</http>
|
||||
</request>
|
||||
|
||||
<thinktime min="1" max="5" random="true"/>
|
||||
</session>
|
||||
</sessions>
|
||||
</tsung>
|
||||
Reference in New Issue
Block a user