locustio / locust

Write scalable load tests in plain Python 🚗💨
https://locust.cloud
MIT License
25.06k stars 3k forks source link

Locust test results #639

Closed liuchang6 closed 7 years ago

liuchang6 commented 7 years ago

Hello, I tested the POST interface with Locust. As a result, is there something wrong with me? 0q7vbllw 3 49roc wqlerm ytk 2z2 xq9 h_4so 5ygh e3 8z xe71 _6 `jxb59sn5

from locust import HttpLocust,TaskSet,task,Locust

class WebsiteTasks(TaskSet):
    @task()
    def go(self):
        header = {'Content-Type': 'application/json',
                   'Authorization': 'eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJCTUtQIiwidiI6MSwasdiMTM2IiwiaWF0IjoxNTAxNDadJjbGFpbXMiOnsicm9sZSadaXZlciIsInBob25lIjoiMTU4Mjc2MjgxMzkiLCJ0eXBlIjoiYW5kcm9pZCIsInZlcnNpb24iOiI0LjAuMCJ9LCJhZG1pbiI6ZmFsc2UsImV4cCI6MTUwMjc3NzI5NH0.k-Con5IkURvaus-HXkxVY5w6ihaHzMNmlLb77IrQyNE'
                   }

        self.client.post("/wyc/v400/zebra/walker/setPos",header, {
                    "speed": 0.0,
                    "orderId": "421",
                    "walkerPhone": "15827631231",
                    "latitude": "30.478699",
                    "deviceKey": "3a4fe19f001fdf30",
                    "longtitude": "114.427418",
                    "drvId": 58,
                    "direction": 0
                })

class WebsiteUser(HttpLocust):
    task_set = WebsiteTasks
    host = 'https://xx.xx.xx'
    min_wait = 1000
    max_wait = 2000
aldenpeterson-wf commented 7 years ago

I don't understand your question, what are you asking?

heyman commented 7 years ago

If you're not getting the performance you're expecting (I'm guessing here) I must refer you to this note from the documentation:

image

You can't use Locust on Windows to perform any real test with many users. You could maybe get a decent performance if you run it through Docker on Windows (though I have not tested this).