Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ce27e73
working commit
Jun 14, 2022
8e5815d
implemented poisson arraival time given an rps interval
Jun 14, 2022
051bf6f
initial summary prints out
Jun 28, 2022
8d9bac5
added timestamps, changed file type to csv, filenames include rps + i…
Jul 5, 2022
500b439
Sarah's scripts
Jul 5, 2022
69a1c66
fixed summary orders + added errors
Jul 8, 2022
2a9cc70
script fixes
Jul 11, 2022
dc0578a
intitial automation can run multiple tests given a list of rps rates …
Jul 11, 2022
a7288b7
fixed bug of script not ending moved most of summary to request gener…
Jul 11, 2022
1e080ea
summary average bug fix
Jul 11, 2022
c1449c1
used forked process to start flask
Jul 11, 2022
08cf5d5
amanda's script + 99ile graphing script
Jul 12, 2022
bc06033
scripts as pictures
Jul 14, 2022
5279745
clean up for code review
Jul 26, 2022
fd889c1
policy 1: weighted urls working
Aug 2, 2022
403353a
Update linegraph.py
ascoville22 Aug 13, 2022
1b8ae8c
closed and open loop policies
Aug 13, 2022
97d670f
comments + midsummer milestone fixes
Aug 16, 2022
70e9d03
scripts read command line arguments
Aug 16, 2022
5bd7209
readme outline + req-gen no automation fix
Aug 16, 2022
591d491
full initial readme
Aug 16, 2022
678233d
fix
Aug 16, 2022
c00eda3
fix
Aug 16, 2022
9a1ebf2
fix
Aug 16, 2022
5d4e36a
readme fix
Aug 16, 2022
e5a95dc
readme
Aug 16, 2022
52dbd70
fix
Aug 16, 2022
fa3a150
readme formatting
Aug 16, 2022
b955d99
formatting
Aug 16, 2022
ec16d8e
sh file
Aug 16, 2022
c55e100
spacing
Aug 16, 2022
eeb885e
spacing
Aug 16, 2022
1b185d7
spacing fix
Aug 16, 2022
66a1667
formatting
Aug 16, 2022
d5f45b3
fix
Aug 16, 2022
18f6da6
fix
Aug 16, 2022
5aa7d50
fix
Aug 16, 2022
2be017f
Merge pull request #2 from dania2512/client_policies
dania2512 Aug 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,96 @@

[![Package quality](http://packagequality.com/badge/loadtest.png)](http://packagequality.com/#?package=loadtest)

# Gwloadtest

Gwloadtest modified loadtest to creat load tests that imitate client-behavior more closely by using randomly distributed time intervals between requests and allowing for more random url access behavior.

## How to Use

1. clone this repository, and open the newly cloned directory:

```
git clone https://github.com/gwcloudlab/gwloadtest.git
```

2. Install Node.js and npm by by running the following commands:

```
./install_node.sh
```

3. Modify sample/request-generator.js with desired options
4. Run the following command to run the test:

```
node sample/request-generator.js
```
## Modfifications

### Poisson Interarrival time

Given a requests per second rate and a time inerval for the load test, gwloadtests send requests at randomly distributed time intervals.

### Logs and Summaries

Gwloadtest prints a summary text file along with a log file that includes the index, timestamp, latency, status code, and url of every request.

## Additions

### Client Modes

In an attempt to resmeble client behavior, gwloadtest carries two client behavior policies.

#### Closed Loop

The client thread sends a request and waits for it to return an html, which it then parses for hyperlinks and randomly selects a link so send the next request to. If no links are found, it sends the next request to the options url.

usage example:
```javascript
const options = {
url: 'http://127.0.0.1:5000',
statusCallback: statusCallback,
requestsPerSecond: 10,
rpsInterval: 10,
clientMode: 'closed'
};
```

#### Open Loop

The client thread sends requests to multiple links according to the weights given in a file. A file must be passed in along with selecting the open clientMode.

usage example:
```javascript
const options = {
url: 'http://127.0.0.1:5000',
statusCallback: statusCallback,
requestsPerSecond: 10,
rpsInterval: 10,
urlList: 'sample/url_list.txt', //include title of file here
clientMode: 'open'
};
```
sample/url_list.txt:
```
url, weight
http://127.0.0.1:5000, 0.80
http://127.0.0.1:5000/test1, 0.20
```

### graphing scripts

Gwloadtest carries 4 types of graphing scripts in the scripts file, which can be run on the Gwloadtest generated log files.
1. 99th percentile latency vs. requests per second rate
2. number of occurences vs latency histogram
3. latency over time line graph
4. cdf vs response time


### Automation Script

For research purposes, automation/run.py can run multiple tests given a list of requests per second rates.

# loadtest

Runs a load test on the selected HTTP or WebSockets URL. The API allows for easy integration in your own tests.
Expand Down
16 changes: 16 additions & 0 deletions automation/function.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import time
from flask import Flask
fibapp = Flask(__name__)
@fibapp.route('/')
def index():
# temp()
return "Hello World!"

def temp():
time.sleep(0.1)
print("waited")
return

if __name__ == '__main__':
fibapp.run()
23 changes: 23 additions & 0 deletions automation/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os, json
import subprocess
from tracemalloc import start
from Naked.toolshed.shell import execute_js



def generateLoad(req, duration):
command = "sample/request-generator.js --rps=" + str(req) + " --interval=" + str(duration)
execute_js(command) #run the script with the arguments

def main():
TEST_LIST = [1, 5, 10, 50, 100, 500, 1000]
duration = 10
# start_function()
for test in TEST_LIST:
generateLoad(test, duration)




if __name__ == "__main__":
main()
4 changes: 4 additions & 0 deletions install_node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sudo apt update
sudo apt-get install -y nodejs
cd ~/gwloadtest
npm install
Loading