Last active
January 7, 2020 08:31
-
-
Save ywolff/4d9910d02a77cdbd8617dd5d9faa00a3 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
import numpy as np | |
from locust import HttpLocust, TaskSet, task, between | |
INPUT_WIDTH = 10 | |
class PredictTaskSet(TaskSet): | |
@task(1) | |
def predict(self): | |
payload = { | |
'input': np.random.random((1, INPUT_WIDTH)).tolist() | |
} | |
self.client.post('/predict', json=payload) | |
class PredictLocust(HttpLocust): | |
task_set = PredictTaskSet | |
wait_time = between(1, 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment