0

问题

我正在使用以下目标文件

GET https://foo.bar.com
GET https://bar.foo.com
GET https://zoo.lander.com

然后发出

vegeta attack -targets=targetsFile -duration=2s | tee results.bin | vegeta report  

然后我得到一个汇总报告,例如:

Requests      [total, rate, throughput]         100, 50.57, 24.76
Duration      [total, attack, wait]             3.837s, 1.978s, 1.859s
Latencies     [min, mean, 50, 90, 95, 99, max]  156.862ms, 583.523ms, 417.547ms, 832.023ms, 1.114s, 2.816s, 3.677s
Bytes In      [total, mean]                     20643, 206.43
Bytes Out     [total, mean]                     0, 0.00
Success       [ratio]                           95.00%
Status Codes  [code:count]                      200:95  404:5  
Error Set:
404 Not Found

有没有办法获得每个目标的不同报告(可能还有情节)?我必须拆分目标吗?

4

1 回答 1

2

我不认为贝吉塔支持这一点。我认为您可以通过传递配置文件来使用Ddosify 。它将打印每个端点的指标。

您的场景的示例配置文件;

{
    "request_count": 100,
    "load_type": "linear",
    "duration": 2,
    "output": "stdout",
    "steps": [
        {
            "id": 1,
            "url": "https://foo.bar.com",
            "protocol": "https",
            "method": "GET",
            "timeout": 3
        },
        {
            "id": 2,
            "url": "https://bar.foo.com",
            "protocol": "https",
            "method": "GET",
            "timeout": 3
        },
        {
            "id": 3,
            "url": "https://zoo.lander.com",
            "protocol": "https",
            "method": "GET",
            "timeout": 3
        }
    ]
}

然后运行;

ddosify -config config.json

输出;

RESULT
-------------------------------------

1. Step 1
---------------------------------
Success Count:    100   (100%)
Failed Count:     0     (0%)

Durations (Avg):
  DNS                  :0.0743s
  Connection           :0.0528s
  TLS                  :0.0734s
  Request Write        :0.0001s
  Server Processing    :0.0918s
  Response Read        :0.3214s
  Total                :0.6138s

Status Code (Message) :Count
  200 (OK)    :100


2. Step 2
---------------------------------
Success Count:    100   (100%)
Failed Count:     0     (0%)

Durations (Avg):
  DNS                  :0.0573s
  Connection           :0.0536s
  TLS                  :0.0747s
  Request Write        :0.0001s
  Server Processing    :0.0906s
  Response Read        :0.3065s
  Total                :0.5828s

Status Code (Message) :Count
  200 (OK)    :100


3. Step 3
---------------------------------
Success Count:    100   (100%)
Failed Count:     0     (0%)

Durations (Avg):
  DNS                  :0.0541s
  Connection           :0.0531s
  TLS                  :0.0753s
  Request Write        :0.0001s
  Server Processing    :0.0885s
  Response Read        :0.3167s
  Total                :0.5878s

Status Code (Message) :Count
  200 (OK)    :100

于 2022-02-08T14:14:00.097 回答