Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Li committed Dec 12, 2024
1 parent 0bcf2ae commit faed7d8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ Introductory video: 快拍视频!!!!
## Project Description:
This project incorporated all the skills we learned in Data Engineering to create a application offers services for analyzing movie popularity and genre trends over time. Users can input a start and end year to explore how different movie genres have evolved in popularity. Additionally, users can enter a specific year to view the most and least popular movies based on TMDB's popularity scores. The site also features an AI chat assistant for interactive user engagement using X.AI API. The following technologies are used for this project:

- ![SQL](https://img.shields.io/badge/Database-SQL-blue?logo=postgresql&logoColor=white)
- ![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white) ![CSS](https://img.shields.io/badge/css3-%231572B6.svg?style=for-the-badge&logo=css3&logoColor=white) ![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)
- ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) ![Flask](https://img.shields.io/badge/flask-%23000.svg?style=for-the-badge&logo=flask&logoColor=white)
- ![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) ![Flask](https://img.shields.io/badge/flask-%23000.svg?style=for-the-badge&logo=flask&logoColor=white) ![SQL](https://img.shields.io/badge/sql-%2307405e.svg?style=for-the-badge&logo=postgresql&logoColor=white)
- ![Azure](https://img.shields.io/badge/azure-%230072C6.svg?style=for-the-badge&logo=microsoftazure&logoColor=white) ![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white) ![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)


Expand All @@ -31,7 +30,7 @@ This project incorporated all the skills we learned in Data Engineering to creat
### 1. Frontend
- 使用HTML5、CSS3和JavaScript构建用户界面
- 使用Chart.js进行数据可视化
- 实现了响应式设计确保在不同设备上的良好显示
- 实现了响应式设计��确保在不同设备上的良好显示

### 2. Backend
- Flask作为Web框架
Expand Down Expand Up @@ -104,6 +103,7 @@ locust -f load_test.py --host=https://www.ids706final.dingzhen.us
Here are the test results:

<img width="1242" alt="Screenshot 2024-12-12 at 01 17 19" src="https://github.com/user-attachments/assets/cfc2e1ef-235d-48f6-96f8-544281ee4728" />

![total_requests_per_second_1733983092 742](https://github.com/user-attachments/assets/73f8beaf-ea43-4d1b-bfd2-782fb321bedb)

Due to our Azure Student Subscription limitations, we could only use Standard S3 SKU with a maximum of 10 instances. Each instance was configured with 9 workers and 4 threads to achieve maximum concurrent capacity.
Expand Down
30 changes: 24 additions & 6 deletions load_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,46 @@


class WebsiteUser(HttpUser):
wait_time = between(0.5, 1)
wait_time = between(1, 2) # think time 1-2s
connection_timeout = 2 # connection timeout 2s
network_timeout = 3 # network timeout 3s

@task
def health_check(self):
with self.client.get("/analysis/health", catch_response=True, timeout=5.0) as response:
with self.client.get(
"/analysis/health",
catch_response=True,
timeout=5.0,
verify=False # if https, can disable certificate verification to improve performance
) as response:
if response.status_code != 200:
response.failure(
f"Failed with status code: {response.status_code}")
else:
response.success()

def on_start(self):
# initialize operations when user starts
pass


class StagesShape(LoadTestShape):
stages = [
{"duration": 30, "users": 2500, "spawn_rate": 85}, # 30秒内达到2500用户
{"duration": 60, "users": 5000, "spawn_rate": 85}, # 60秒内达到5000用户
{"duration": 90, "users": 7500, "spawn_rate": 85}, # 90秒内达到7500用户
{"duration": 120, "users": 10000, "spawn_rate": 85} # 120秒内达到10000用户
# stage 1: reach 2500 users in 30s
{"duration": 30, "users": 2500, "spawn_rate": 85},
# stage 2: reach 5000 users in 60s
{"duration": 60, "users": 5000, "spawn_rate": 85},
# stage 3: reach 7500 users in 90s
{"duration": 90, "users": 7500, "spawn_rate": 85},
# stage 4: reach 10000 users in 120s
{"duration": 120, "users": 10000, "spawn_rate": 85},
# stage 5: maintain 10000 users for 60s
{"duration": 180, "users": 10000, "spawn_rate": 85}
]

def tick(self):
run_time = self.get_run_time()

for stage in self.stages:
if run_time < stage["duration"]:
return stage["users"], stage["spawn_rate"]
Expand Down

0 comments on commit faed7d8

Please sign in to comment.