Created
July 10, 2022 22:08
-
-
Save ashmibanerjee/0a7015d45feb5a9b052973dea41d1799 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from locust import HttpUser, task, between | |
from src.app.app import Img | |
import json | |
class PerformanceTests(HttpUser): | |
wait_time = between(1, 3) | |
@task(1) | |
def test_tf_predict(self): | |
sample = Img(img_url="https://raw.githubusercontent.com/pytorch/hub/master/images/dog.jpg") | |
headers = {'Accept': 'application/json', | |
'Content-Type': 'application/json'} | |
res = self.client.post("/predict/tf/", | |
data=json.dumps(sample.dict()), | |
headers=headers) | |
print("res", res.json()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment