最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python locust config file for multiple filesclasses - Stack Overflow

programmeradmin2浏览0评论

I'm using locust to do some load testing on our backend service and I have three classes defined in three different .py files

then I'm trying to run locust using this command line

==> locust -f locustfiles/locustfile.py --headless --config ../loadTestConfig.yml

locustfile.py

from myClass1 import MyClass1 
from myClass2 import MyClass2 
from myClass3 import MyClass3 

loadTestConfig.yml

    user_classes:
      - class: MyClass1
        users: 8
        spawn_rate: 8
      - class: MyClass2
        users: 2
        spawn_rate: 2
      - class: MyClass3
        users: 36
        spawn_rate: 36
    
    run_time: 2m
    host: "https://myhost"

this would give me the error when lunched that it's not recongizing the option class from the yml file.

TestConfig.yml
locust: error: ambiguous option: --=class: MyClass3 could match --locustfile, --config, --help, --version, --worker, --master, --master-host, --master-port

How could I specify per class (file) the number of user and spwan rate?? Trying to buld my load scenario.

发布评论

评论列表(0)

  1. 暂无评论