Create Ubuntu VM


Install an xRDP Server on your Ubuntu VM
sudo apt install xrdp
sudo systemctl status xrdp
#Output:
● xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) since (...)
xRDP uses the SSL key in /etc/ssl/private/ssl-cert-snakeoil.key which is only readable by members of the 'ssl-cert' group. We need to add the 'xrdp' user to the group. We then need to restart the xRDP server.
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp
Finally, you need to make sure port 3389 (used by the RDP protocol) is accessible from wherever you want to use the RDP client on, you can specify an IP range, or simply allow everyone (in which case they would also need a user/password to be able to enter). This is done by configuring the Ubuntu FW.
#specify IP range that can access port 3389
sudo ufw allow from 192.168.33.0/24 to any port 3389
#OR allow everyone
sudo ufw allow 3389
xRDP is now installed!
Use Microsoft remote desktop to connect to the instance 35.201.190.131
Add user to Ubuntu
adduser claire123
pw claire123
Install and Setup Apache JMeter on your Ubuntu VM!
/bin/bash -c "$(curl -fsSL [<https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)](<https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>))" It can take a while. Please be patient. Go get your own real homebrew setup in the meantime, If you don't have one, here's a kit on Amazon to get you started: https://www.amazon.co.uk/Beer-Making-Kit-Lager-5-Litre/dp/B00P17OFI0/ref=sr_1_1_sspa?crid=2KTPITOZ3LPNW&keywords=homebrew+kit&qid=1662034799&sprefix=homebrew+kit%2Caps%2C103&sr=8-1-spons&psc=1 jmeter`Once Apache JMeter has completed its installation you have to open its GUI. You do this by executing the JMeter's binary file. In Linux deployments Homebrew will install it under /home/linuxbrew/.linuxbrew/Cellar/jmeter/5.5/bin/jmeter: cd into the 'bin' directory and run JMeter.
Log in via the Microsoft desktop
Open terminal
cd /home/linuxbrew/.linuxbrew/Cellar/jmeter/5.5/bin
./jmeter
Add a new thread group


now add customization properties to our HTTP Request object. Right-click 'HTTP Request' and add the following objects:
Let's start by giving a JMeter a way to know which API endpoints to call. We are going to perform GET requests as we only need to hear a 200 OK HTTP status code back from Cloudflare. We do this by setting up our 'CSV Data Set Config' object to pull data from a .csv file with a list of endpoints that JMeter will append to the URL of each request. We need to check the Petstore API for all GET endpoints and list those. This is in /home/claire123/Documents/api-get.csv

Write down the variable name you will use. This is will represent an addressable global variable that you can refer to when setting up your HTTP request settings. In my case I used the name 'random_path_petstore'.
Now click on your 'HTTP Header Manager' settings. This is where we will provide JMeter with both our session identifier and accept headers.
The session identifier is a variable required by API Discovery. This is how API Discovery is able to differentiate your API users. It's also how API Discovery filters the API calls that it should take into account. If this header is not in the API request, Discovery won't care for it.
First, go to your API Shield settings in your Cloudflare dashboard and add a Session Identifier. Choose the header option. Give it whatever name you want! I have two APIs proxied through my setup which is why you see 2 different session identifiers on the following screenshot - 'session-identifier-mdias' and 'session-identifier-petstoreapi-mdias'. For the Petstore API I used the latter. You can absolutely use a single identifier for all of your APIs.

Finally, let's edit our 'HTTP Request' settings so that JMeter knows which API to call.
Use 'https' as your Protocol and enter your API hostname under 'Server Name or IP'.
Choose 'GET' as your HTTP request method. For the Path you have to make sure it's leading to Petstore V3 and that it's appending the headers you have supplied to your 'CSV Data Set Config' object. If you used the same variable name as me, your Path should value should be the following:

Set thread group

'Number of Threads (users)', a 'Ramp-up period' (time it takes to ramp-up the the threads list),
In that example I have 5 Threads and 10 seconds of ramp-up. This means that for the first second, the generator will send out 1 API call with one value of session identifer, for the second second, the generator will send out 2 API calls with two values of session identifiers, and so on until the sixth second, where the generator will send out 5 API calls with 5 unique values of session identifiers.
Config of jmx is saved. Do not forget to save your Apache JMeter setup somewhere! It will save your setup as a .jmx file that you will be able to load onto other instances of JMeter if you need.

View the result tree

make sure u are getting the logs on instant logs
