demodeploy / test.py
Abineshkumar77
Add applicationย file
bcb48e9
raw
history blame contribute delete
683 Bytes
from locust import HttpUser,task,between
import random
tweet=["One day, a dark sorcerer named Malakar descended upon Eldoria" ,
"Malakar sought to plunge the world into eternal darkness" ,
"using a powerful artifact known as the Shadow Crystal."
,"The villagers were terrified, and hope seemed lost. "
"The king of the land sent out a call for a hero to retrieve the crystal and restore light to the world."]
class AppUser(HttpUser):
wait_time=between(2,5)
@task
def home(self):
self.client.get("/")
@task
def analyze_sentiment(self):
mytweet=random.choice(tweet)
self.client.get("/analyze"+str(mytweet))