Page MenuHomePhabricator
Paste P54825

article descriptions isvc load test script using locust
ActivePublic

Authored by kevinbazira on Jan 17 2024, 2:52 PM.
from locust import FastHttpUser, task, between
class ArticleDescriptionsUser(FastHttpUser):
wait_time = between(1, 2) # Adjust wait time as needed
host = "https://inference-staging.svc.codfw.wmnet:30443"
@task
def predict(self):
headers = {
"Host": "article-descriptions.experimental.wikimedia.org",
"Content-Type": "application/json"
}
data = {"lang": "en", "title": "Clandonald", "num_beams": 3}
self.client.post("/v1/models/article-descriptions:predict",
json=data,
headers=headers)