Skip to content

Commit

Permalink
sample tsung script
Browse files Browse the repository at this point in the history
  • Loading branch information
praneeth-bala committed Nov 26, 2024
1 parent 643a738 commit ece080c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/signup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"user": {
"name": "Test User %%ts_user_server:get_unique_id%%",
"email": "testuser%%ts_user_server:get_unique_id%%@example.com",
"password": "Password123",
"password_confirmation": "Password123"
}
}
50 changes: 50 additions & 0 deletions scripts/signupHome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" [] >
<tsung>
<clients>
<client host="localhost" use_controller_vm="true" />
</clients>
<servers>
<server host="rails-to-riches.eba-viwn7vp8.us-west-2.elasticbeanstalk.com" port="80" type="tcp" />
</servers>
<load>
<arrivalphase phase="1" duration="60" unit="second">
<users arrivalrate="1" unit="second"></users>
</arrivalphase>
<arrivalphase phase="2" duration="60" unit="second">
<users arrivalrate="2" unit="second"></users>
</arrivalphase>
<arrivalphase phase="3" duration="60" unit="second">
<users arrivalrate="4" unit="second"></users>
</arrivalphase>
<arrivalphase phase="4" duration="60" unit="second">
<users arrivalrate="8" unit="second"></users>
</arrivalphase>
<arrivalphase phase="5" duration="60" unit="second">
<users arrivalrate="16" unit="second"></users>
</arrivalphase>
<arrivalphase phase="6" duration="60" unit="second">
<users arrivalrate="32" unit="second"></users>
</arrivalphase>
</load>
<sessions>
<session name="signup_test" probability="100" type="ts_http">
<!-- User Signup -->
<request subst="true">
<dyn_variable name="jwt" re='\"jwt\":\"([^\"]+)\"' />
<http url="/api/signup" method="POST" contents_from_file="./signup.json">
<http_header name="Content-Type" value="application/json" />
</http>
</request>
<thinktime value="1" />

<!-- Access Dashboard -->
<request>
<http url="/api/restaurants" method="GET">
<http_header name="Authorization" value="Bearer ${jwt}" />
</http>
</request>
<thinktime value="1" />
</session>
</sessions>
</tsung>

0 comments on commit ece080c

Please sign in to comment.