Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit ece080c

Browse files
committed
sample tsung script
1 parent 643a738 commit ece080c

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

scripts/signup.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"user": {
3+
"name": "Test User %%ts_user_server:get_unique_id%%",
4+
"email": "testuser%%ts_user_server:get_unique_id%%@example.com",
5+
"password": "Password123",
6+
"password_confirmation": "Password123"
7+
}
8+
}

scripts/signupHome.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" [] >
3+
<tsung>
4+
<clients>
5+
<client host="localhost" use_controller_vm="true" />
6+
</clients>
7+
<servers>
8+
<server host="rails-to-riches.eba-viwn7vp8.us-west-2.elasticbeanstalk.com" port="80" type="tcp" />
9+
</servers>
10+
<load>
11+
<arrivalphase phase="1" duration="60" unit="second">
12+
<users arrivalrate="1" unit="second"></users>
13+
</arrivalphase>
14+
<arrivalphase phase="2" duration="60" unit="second">
15+
<users arrivalrate="2" unit="second"></users>
16+
</arrivalphase>
17+
<arrivalphase phase="3" duration="60" unit="second">
18+
<users arrivalrate="4" unit="second"></users>
19+
</arrivalphase>
20+
<arrivalphase phase="4" duration="60" unit="second">
21+
<users arrivalrate="8" unit="second"></users>
22+
</arrivalphase>
23+
<arrivalphase phase="5" duration="60" unit="second">
24+
<users arrivalrate="16" unit="second"></users>
25+
</arrivalphase>
26+
<arrivalphase phase="6" duration="60" unit="second">
27+
<users arrivalrate="32" unit="second"></users>
28+
</arrivalphase>
29+
</load>
30+
<sessions>
31+
<session name="signup_test" probability="100" type="ts_http">
32+
<!-- User Signup -->
33+
<request subst="true">
34+
<dyn_variable name="jwt" re='\"jwt\":\"([^\"]+)\"' />
35+
<http url="/api/signup" method="POST" contents_from_file="./signup.json">
36+
<http_header name="Content-Type" value="application/json" />
37+
</http>
38+
</request>
39+
<thinktime value="1" />
40+
41+
<!-- Access Dashboard -->
42+
<request>
43+
<http url="/api/restaurants" method="GET">
44+
<http_header name="Authorization" value="Bearer ${jwt}" />
45+
</http>
46+
</request>
47+
<thinktime value="1" />
48+
</session>
49+
</sessions>
50+
</tsung>

0 commit comments

Comments
 (0)