当前位置:网站首页>apache 压力测试工具 ab ,带post参数,token请求
apache 压力测试工具 ab ,带post参数,token请求
2022-07-16 08:10:00 【qq_27878777】
一. 请求
post参数 postdata.txt
name=chang&password=11111ok
PS: 记住请求链接, 参数 用双引号, 否则接收不到参数
ab -n 1 -c 1 -p D:\phpstudy_pro\WWW\postdata.txt -T application/x-www-form-urlencoded -H "token:eyJhbGciOiJIU" "http://www.test.com/index/index/abTest"
测试报告导出到html ,请加 -w 格式化网页
ab -w -n 1 -c 1 -p D:\phpstudy_pro\WWW\postdata.txt -T application/x-www-form-urlencoded -H "token:eyJhbGciOiJIU" "http://www.test.com/index/index/abTest" >> >>D:\miss.html
二. 接收参数
/** * ab 压力测试带post,header头 参数 */
public function abTest(Request $request)
{
$fileName = __DIR__ .'/cert/abtest.txt';
$tmpArr = array();
$name = $request->post('name');
$password = $request->post('password');
$token = $request->header('token');
if($name && $password){
$tmpArr = $request->pathinfo();
$jsonStr = json_encode($tmpArr);
$newLog ='log_time:'.date('Y-m-d H:i:s ').$jsonStr." {
$name} -- {
$password} -- {
$token} ";
file_put_contents($fileName,$newLog.PHP_EOL,FILE_APPEND);
return 'ab测试';
}
}
三. 请求记录
abtest.txt
log_time:2022-07-14 10:59:15 "index\/abTest" chang -- 11111ok -- token111
log_time:2022-07-14 10:59:58 "index\/abTest" chang -- 11111ok -- eyJhbGciOiJIU
这是 ApacheBench,版本 2.3 <$Revision: 1843412 $>
版权所有 1996 Adam Twiss,Zeus Technology Ltd,http ://www.zeustech.net/
授权给 Apache 软件基金会,http://www.apache.org/
..完毕
服务器软件: 阿帕奇/2.4.39
服务器主机名: www.test.com
服务器端口: 80
文档路径: /index/index/abTest
文件长度: 33197 字节
并发级别: 1
测试所需时间: 0.067 秒
完成请求: 1
失败的请求: 0
转让总额: 33420 字节
发送的整体: 221
传输的 HTML: 33197 字节
每秒请求数: 14.83
传输率: 收到 484.11 kb/s
3.20 kb/s 发送
总计 487.31 kb/s
连接时间(毫秒)
分钟 平均 最大限度
连接: 1 1 1
加工: 66 66 66
全部的: 67 67 67
边栏推荐
- How to understand the difference between aav2/2, aav2/5, aav2/8 and aav2/9
- 大咖说*计算讲谈社|三星堆奇幻之旅:只有云计算才能带来的体验
- MySQL field type selection
- 软件测试面试:请说一下你工作中发现的最有价值的bug?
- Surmonter les défis de la transformation numérique en élaborant une vision
- 【前缀和和差分】
- 通过制定愿景克服数字化转型挑战
- [halcon] writeimage save image crash
- How to handle code exceptions gracefully with assertion ideas
- 高性能定時器
猜你喜欢

APISIX 如何与 Hydra 集成,搭建集中认证网关助力企业安全

Airiot low code development platform, 10 minutes to build the Internet of things system

iowait 理解

High performance timer

Do you know the meaning of call concurrency in okcc?

What are the core technologies of okcc call center system
![[batch dos-cmd command - summary and summary] - symbolic link, hard link, soft link, directory link (mklink)](/img/6a/3ad123f7015b63e5a8e0e45dd523bd.png)
[batch dos-cmd command - summary and summary] - symbolic link, hard link, soft link, directory link (mklink)
![[postponed] 2022 International Conference on network and information security (nisecurity 2022)](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[postponed] 2022 International Conference on network and information security (nisecurity 2022)

免费SSL证书申请及部署实践
![[halcon] writeimage save image crash](/img/c6/fdfe031f0836a61dbc3cf3634e244e.png)
[halcon] writeimage save image crash
随机推荐
VR (I) ATW ASW
Charles使用教程
What are the core technologies of okcc call center system
[training Day2] cinema ticket [combinatorics] [Cartland number]
UE4/5中的旋转:三个欧拉角Picth、Yaw、Roll及FRotator
笔记-如何在稀烂的数据中做深度学习
[batch dos-cmd command - summary and summary] - symbolic link, hard link, soft link, directory link (mklink)
leetcode:378. The k-th smallest element in an ordered matrix
Use tcpkill to block packets of the specified TCP connection
【直播报名】OceanBase深入浅出第七期
通过制定愿景克服数字化转型挑战
gradle
声明式事务管理例题
AutoJs学习-TTS抢语音红包
Code to celebrate the Dragon Boat Festival -- Zong your heart
最近VS2019下载速度慢的解决办法
I/O复用之同时处理TCP和UDP服务
指定 TLS 1.3 和 Ciphers 以提升安全性及性能
【前缀和和差分】
VR(一)ATW ASW