Baton HTTP 负载测试工具开源项目

我要开发同款
匿名用户2021年10月27日
108阅读
开发技术GO语言
所属分类Google Go、性能测试和优化、开发工具
授权协议Apache 2.0

作品详情

Baton是一个用Go编写的HTTP 负载测试工具,目前支持GET、POST、PUT和DELETE请求。

安装$goget-ugithub.com/americanexpress/baton使用

目前支持以下选项

-bstringBody(useinsteadof-f)-cintNumberofconcurrentrequests(default1)-fstringFilepathtofiletobeusedasthebody(useinsteadof-b)-iIgnoreTLS/SSLcertificatevalidation-mstringHTTPMethod(GET,POST,PUT,DELETE)(default"GET")-oSupressoutput,noresultswillbeprintedtostdout-rintNumberofrequests(useinsteadof-t)(default1)-tintDurationoftestinginseconds(useinsteadof-r)-ustringURLtorunagainst-wintNumberofsecondstowaitbeforerunningtest-zstringReadrequestsfromafile

下面是使用10个终端发送200,000个请求的基本示例:

 

$baton-uhttps://localhost:8080/test-c10-r200000

可以指定发送请求的时间(以秒为单位),而不是请求的数量,Baton会等收到所有响应之后才报告结果。

请求文件

如果从-zfilename指定加载请求的文件,文件必须为CSV格式。

<method>,<url>,[<body>],[<header-key>:<header-value>,...]...

可以在末尾有一个或多个标题,用 , 隔开,比如:

POST,https://localhost:8888,body,Accept:application/xml,Content-type:SecretGET,https://localhost:8888,,,输出示例======================Results======================Totalrequests:1254155Timetakentocompleterequests:10.046739294sRequestspersecond:124832Maxresponsetime(ms):440Minresponsetime(ms):55Avgresponsetime(ms):156.70=====================Breakdown=====================Numberofconnectionerrors:0Numberof1xxresponses:0Numberof2xxresponses:1254155Numberof3xxresponses:0Numberof4xxresponses:0Numberof5xxresponses:0=====================================================
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论