StressBook is a streamlined database-focused project to analyze and optimize performance, speed, and memory usage in an event booking system. This project simulates a concert booking environment, emphasizing efficient data management and high-performance querying under load. The project inspiration comes from a friend that complains about the hardship of booking a popular concert or theater.
- Python
- MongoDB
- Install packages from requirements.txt
pip install virtualenv
Or
py -m pip install virtualenv
Note: Everyone Project Folder Directory Is Different
cd C:\Users\PC\Desktop\booking_system\INF2003-database-second-project
Note: env is the name for our environment, it can be venv too, just a name
py -m venv env
Operating System : Window
env\Scripts\activate
Operating System : MacOS
source env/bin/activate
pip install -r requirements.txt
Or
py -m pip install -r requirements.txt
Change To The Project Directory
cd stressbook
Run The Project
py main.py
Or
python main.py
Or
python -m main run
Copy The Local Host Link And Paste It To The Browser For Example:
http://127.0.0.1:5000
Change To The Locust File Directory
cd locust_tests
Lets Say You Are Planning To Do Locust Test File Named "simulate_concurrent_users" In concurrent_user_load Folder
Type This Command In The Command Prompt
locust -f concurrent_user_load/simulate_concurrent_users.py
Copy The Local Host Link And Paste It To The Browser For Example:
http://localhost:8089
- Number Of Users (Peak Concurrency): Total Number Of Simulated Users That Would Be Using Your Program Through Locust Test Script
- Ramp Up (Users Started/second): The Rate At Which New Users Are Spawned Until The Peak Concurrency Is Reached. For Example, Value Set To "5" And "Number Of Users" To "100", Locust Will Add 5 Users Per Second Until It Reaches 100 Users.
- Host: http://127.0.0.1:5000 (For Our Project, Follow Your Port Number, Thank You) Unless We Are Planning To Deploy Our Website Then We Use Real URL
- Advanced Options : https://docs.locust.io/en/stable/configuration.html , Can Type Through Command Prompt Or Create A Locust Environment File With The Necessary Environment Variables , In The Code Then We Access Those Environment Variables (Later Stage, After UI And Backend Logic Done, Then Will Take A Look)
- After step 4, you pip install the packages that you needed for the project
- Pip freeze > requirements.txt (Create the requirements.txt file, inside contains all the packages and the respective versions)
- Proceed to step 5 for the people who have pulled the project and created the virutal environment.