diff --git a/docs/Web/Others/Seckill.md b/docs/Web/Others/Seckill.md index a8f8ae6..8b39fa0 100644 --- a/docs/Web/Others/Seckill.md +++ b/docs/Web/Others/Seckill.md @@ -108,4 +108,23 @@ return ResponseEntity.status(200).body("秒杀成功");   为了防止重复创建订单,还需要进行一次幂等校验,即根据订单号的唯一性判断是否有重复的。 # 三、压测 -  采用ApiPost工具进行压测。 \ No newline at end of file +  采用JMeter工具进行压测。 +## 3.1 创建测试数据 +  新建users.csv,输入以下内容: +```csv +1 +2 +3 +... +``` + +  然后在`线程组->添加->配置元件->CSV Data Set Config`,设置变量名称为userId。 + +::: tip +不需要输入表头。 +::: + +## 3.2 HTTP请求 +  设置请求路径为`/seckill/${userId}`,设置线程组参数,例如线程数1000,Ramp-Up时间5秒,循环次数为1000,创建聚合报告,执行线程,查看结果。 + +![JMeter](../images/jmeter.png) \ No newline at end of file diff --git a/docs/Web/images/jmeter.png b/docs/Web/images/jmeter.png new file mode 100644 index 0000000..63b7afc Binary files /dev/null and b/docs/Web/images/jmeter.png differ