如何配置 Locust 使用 https?

时间:2021-01-13 21:26:54

标签: python http openssl load-testing locust

我是 Locust 的新手,我正在尝试使用准系统 https GET 来运行请求服务器索引页。

locustfile.py

import time
from locust import HttpUser, task

class QuickstartUser(HttpUser):
    @task
    def index(self):
        self.client.get("/")

my.conf

locustfile = locustfile.py
headless = true
expect-workers = 5
host = https://localhost:8001/
users = 100
spawn-rate = 10
run-time = 10m
csv = out

要开始这个过程,我使用:locust --conf my.conf

我希望它可以工作,但它似乎存在身份验证问题。丢失率为 100%

出:

 Name                                                          # reqs      # fails  |     Avg     Min     Max  Median  |   req/s failures/s
--------------------------------------------------------------------------------------------------------------------------------------------
 GET //                                                           806 806(100.00%)  |     318      15     729     290  |   94.26   94.26
--------------------------------------------------------------------------------------------------------------------------------------------
 Aggregated                                                       806 806(100.00%)  |     318      15     729     290  |   94.26   94.26

Response time percentiles (approximated)
 Type     Name                                                              50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
 GET      //                                                                290    390    450    510    570    630    680    710    730    730    730    806
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
 None     Aggregated                                                        290    390    450    510    570    630    680    710    730    730    730    806


Error report
 # occurrences      Error
--------------------------------------------------------------------------------------------------------------------------------------------
 806                GET //: SSLError(MaxRetryError("HTTPSConnectionPool(host='localhost', port=8001): Max retries exceeded with url: // (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1123)')))"))
--------------------------------------------------------------------------------------------------------------------------------------------

0 个答案:

没有答案
相关问题