locustfile.py 614 Bytes
import time
from locust import HttpUser, task, between, constant, tag


class QuickstartUser(HttpUser):
    # wait_time = between(1, 5)

    @tag('sync')
    @task
    def sync_test(self):
        self.client.get("/sync")

    @tag('async')
    @task
    def async_test(self):
        self.client.get("/async")

    @tag('sync_classification')
    @task
    def sync_classification(self):
        img_path = '/home/lk/MyProject/BMW_F3OCR/数据集/文件分类/营业执照/授信资料-43.jpg'
        files=[('image', ('', open(img_path,'rb'), ''))]
        self.client.post("/sync_classification", files=files)