iT邦幫忙

2024 iThome 鐵人賽

DAY 18
0
Software Development

開發都來不及了還做什麼測試系列 第 18

Day18. Performance Testing - 2

  • 分享至 

  • xImage
  •  

JMeter

https://jmeter.apache.org/

下載最新版的.zip
並在bin裡面找到jMeter.bat並打開

https://ithelp.ithome.com.tw/upload/images/20240914/20108631UyBvxlesLF.png

https://ithelp.ithome.com.tw/upload/images/20240914/20108631BUqPQwK0n8.png

Thread Group

Create a tread group
https://ithelp.ithome.com.tw/upload/images/20240914/20108631pJHNbAcUvb.png

  • Name: Users
  • Number of Threads (users): 10
  • Ramp-up period (seconds): 120
  • Loop Count: 10
  • Specify Thread lifetime: checked
  • Duration (seconds): 60
  • Startup delay (seconds): 10

https://ithelp.ithome.com.tw/upload/images/20240914/20108631l7vjtDL2RX.png

Use sampler

https://ithelp.ithome.com.tw/upload/images/20240914/201086312c7PYOBm08.png

https://ithelp.ithome.com.tw/upload/images/20240914/20108631ApnV5MQAEb.png

https://ithelp.ithome.com.tw/upload/images/20240914/20108631GDvVeMtHMQ.png

執行
但這個並非是一個很好的測試方式

Listeners

Add View Results Tree, View results in table

https://ithelp.ithome.com.tw/upload/images/20240914/20108631ZNTnQwM9n3.png

https://ithelp.ithome.com.tw/upload/images/20240914/20108631CSHWCig0uh.png

再執行一次Request

View Results Tree

https://ithelp.ithome.com.tw/upload/images/20240914/20108631budfs8IzUv.png

View Results in Table

https://ithelp.ithome.com.tw/upload/images/20240914/20108631Dx8lu9Tln9.png

BlazeMeter

https://www.blazemeter.com/

Install google chrome extension
https://chromewebstore.google.com/detail/blazemeter-the-continuous/mbopgmdnpcbohhpnfglgohlbhfongabi?hl=zh-TW&pli=1

https://ithelp.ithome.com.tw/upload/images/20240914/20108631fmRJTxg1bi.png

https://ithelp.ithome.com.tw/upload/images/20240914/20108631hfZVees7IB.png

打開測試網站:https://blazedemo.com/
https://ithelp.ithome.com.tw/upload/images/20240914/20108631rwzsj5GHWB.png

start recording

更改值
https://ithelp.ithome.com.tw/upload/images/20240914/20108631HQFgBHYfb8.png
先新增步驟再動畫面

Save
https://ithelp.ithome.com.tw/upload/images/20240914/20108631wKoeqnloys.png

Open JMeter

File -> Open

https://ithelp.ithome.com.tw/upload/images/20240914/20108631PG8xIm4yoX.png

Add listeners

  • Aggregate Report
  • Summary Report

https://ithelp.ithome.com.tw/upload/images/20240914/20108631ygX5soT1DC.png

https://ithelp.ithome.com.tw/upload/images/20240914/20108631u8Nsakrobk.png

Average vs Medium

Example 1:
100, 1000, 2000, 3000, 100000

Average = (100 + 1000 + 2000 + 3000 + 100000) / 5 = 21220 -> failed
Median = 2000

Example 2:
10, 10, 10, 10, 1000, 9000, 2000

Average = (10 + 10 + 10 + 10 + 1000 + 9000 + 2000) / 7 = 5148
Medium = 10 -> failed

本文章同步發布於個人blogger


上一篇
Day17. Performance Testing - 1
下一篇
Day19. 進階 Performance Testing
系列文
開發都來不及了還做什麼測試30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言