Skip to content

Commit

Permalink
Locust and compose files for performance bench marking and its setup …
Browse files Browse the repository at this point in the history
…and removed old locust
  • Loading branch information
prabinoid committed Dec 24, 2024
1 parent 729cd6b commit 682bb7a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
22 changes: 0 additions & 22 deletions locust/locustfile.py

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/locust/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ services:
working_dir: /app/locust
entrypoint: locust -f /app/locust/locustfile.py
environment:
LOCUST_HOST: "https://tm.naxa.com.np"
LOCUST_HOST: "https://tm-fastapi.naxa.com.np"
10 changes: 8 additions & 2 deletions scripts/locust/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ def get_project(self):
def get_comments(self):
self.client.get("/api/v2/projects/114/comments/")

class ProjectList(TaskSet):
@task
def get_project(self):
self.client.get("/api/v2/projects/")

class GetSimilarProjects(TaskSet):
@task
def get_similar_projects(self):
Expand Down Expand Up @@ -52,8 +57,9 @@ class ApiBenchmarkUser(HttpUser):
# Dynamically select tasks based on environment variable or CLI parameter
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
task_name = os.getenv("TASK_SET", "project_and_comments").lower()
self.tasks = [task_mapping.get(task_name, ProjectAndComments)]
task_name = os.getenv("TASK_SET", "get_contributions").lower()
print(task_name, "The task name....")
self.tasks = [task_mapping.get(task_name, GetContributions)]


'''
Expand Down

0 comments on commit 682bb7a

Please sign in to comment.