-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
174 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE tsung SYSTEM "/usr/local/share/tsung/tsung-1.0.dtd" [] > | ||
<tsung loglevel="debug"> | ||
<clients> | ||
<client host="localhost" maxusers="32768" use_controller_vm="true" /> | ||
</clients> | ||
|
||
<servers> | ||
<server host="ziqi.eba-wqi6mj7g.us-west-2.elasticbeanstalk.com" port="80" type="tcp" /> | ||
</servers> | ||
|
||
<load> | ||
<!-- Phase 1 --> | ||
<arrivalphase phase="1" duration="20" unit="second"> | ||
<users arrivalrate="1" unit="second"></users> | ||
</arrivalphase> | ||
</load> | ||
|
||
<options> | ||
<!-- Set connection timeout to 2 seconds --> | ||
<option name="global_ack_timeout" value="2000"></option> | ||
</options> | ||
|
||
<sessions> | ||
<session name="register-login-logout" type="ts_http" weight="1"> | ||
<setdynvars sourcetype="random_string" length="20"> | ||
<var name="rand_str1" /> | ||
</setdynvars> | ||
|
||
<request subst="true"> | ||
<dyn_variable name="user_id" jsonpath="$.user.id"/> | ||
<http url="/api/signup" method="POST" version="1.1" contents="username=user_%%_rand_str1%%&password=w12345678&password_confirmation=w12345678"> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
<thinktime value="2" random="true"></thinktime> | ||
|
||
<request subst="true"> | ||
<dyn_variable name="user_id_debug" jsonpath="$.user.id"/> | ||
<http url="/api/login" method="POST" version="1.1" contents="username=user_%%_rand_str1%%&password=w12345678"> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
<thinktime value="2" random="true"></thinktime> | ||
|
||
|
||
<setdynvars sourcetype="random_string" length="13"> | ||
<var name="rand_str1" /> | ||
</setdynvars> | ||
|
||
<request subst="true"> | ||
<dyn_variable name="post_id" jsonpath="$.id"/> | ||
<http url="/api/posts" method="POST" version="1.1" contents='{"content": "%%_rand_str1%%"}'> | ||
<http_header name="Content-Type" value="application/json"/> | ||
<http_header name="Accept" value="application/json"/> | ||
</http> | ||
</request> | ||
<thinktime value="2" random="true"></thinktime> | ||
|
||
<setdynvars sourcetype="random_string" length="15"> | ||
<var name="rand_str2" /> | ||
</setdynvars> | ||
|
||
|
||
<request subst="true"> | ||
<http url="/api/posts" method="PUT" version="1.1" contents="postId=%%_post_id%%&content=%%_rand_str2%%"> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
<thinktime value="2" random="true"></thinktime> | ||
|
||
<request subst="true"> | ||
<dyn_variable name="comment_id" jsonpath="$.id"/> | ||
<http url="/api/posts/%%_post_id%%/comments" method="POST" version="1.1" contents='postId=%%_post_id%%&content=comment_%%_rand_str2%%'> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
|
||
<request subst="true"> | ||
<http url="/api/posts/%%_post_id%%/like" method="POST" version="1.1" contents='postId=%%_post_id%%'> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
|
||
<request subst="true"> | ||
<http url="/api/posts/%%_post_id%%" method="DELETE" version="1.1" contents='postId=%%_post_id%%'> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
|
||
|
||
<request subst="true"> | ||
<http url="/api/logout" method="DELETE" version="1.1" contents="user_id=%%_user_id%%"> | ||
<http_header name="Content-Type" value="application/x-www-form-urlencoded"/> | ||
<http_header name="Accept" value="application/x-www-form-urlencoded"/> | ||
</http> | ||
</request> | ||
</session> | ||
</sessions> | ||
</tsung> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters