1. 程式人生 > >linux安裝壓力測試工具vegeta

linux安裝壓力測試工具vegeta

github 地址: https://github.com/tsenart/vegeta/releases
https://github.com/tsenart/vegeta/releases/download/v8.0.0/vegeta-8.0.0-linux-amd64.tar.gz

# 下載
wget https://github.com/tsenart/vegeta/releases/download/v8.0.0/vegeta-8.0.0-linux-amd64.tar.gz

# 解壓
tar zxvf vegeta-8.0.0-linux-amd64.tar.gz 

# 寫target.txt 檔案 內容如下: 
GET https://www.baidu.com


# 測試
./vegeta attack -targets="target.txt" -rate=100 -duration=30s > res.bin

# 分析測試結果
vegeta report -inputs=res.bin -reporter=json > res.json

#檢視json


# 分析請求時間
cat res.bin | ./vegeta report -reporter='hist[0,40ms,100ms,200ms,600ms,1000ms,2000ms]'



#分析結果生成html
cat res.bin | ./vegeta report -reporter=plot > plot.html