Mac 安装 SuperBenchmarker

## SuperBenchmarker简介 SuperBenchmarker 是ㄧ个开源的类似于Apache ab的压力测试命令行工具.可以在 .NET 4.52+ 或者 .NET Core 2.0+ 平台上运行. 可支持http接口压测并生成html格式压测报告, 压测可指定并发数、总请求数、模拟请求调用时间、请求头等信息。 支持 Windows和Mac.本文讲解Mac安装 ## 环境要求 ![image.png](https://upload-images.jianshu.io/upload_images/3575048-606ac279ce64dfc8.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ## Mac 安装 SuperBenchmarker: ### 需要git先下载源码后 build构建完成后才能使用 下载链接: https://github.com/aliostad/SuperBenchmarker ![image.png](https://upload-images.jianshu.io/upload_images/3575048-90255b7ee9da7699.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ``` git clone https://github.com/aliostad/SuperBenchmarker cd SuperBenchmarker ./build.sh ``` ## 首次build构建编译失败 原因: 缺少 .NET 工具包 ![image.png](https://upload-images.jianshu.io/upload_images/3575048-d863fb2cc006d613.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ## .NET 工具包下载地址 => 下载安装Mac版本包安装即可 https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install ![image.png](https://upload-images.jianshu.io/upload_images/3575048-930a4aafb0bfa72a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### .NET 安装完成验证: ``` dotnet ``` ![image.png](https://upload-images.jianshu.io/upload_images/3575048-d5216f46b165aa4e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ## 重新编译安装成功 ![image.png](https://upload-images.jianshu.io/upload_images/3575048-3b9aab1f6905f55a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ## 压测 case 并生成图形化结果结果: ``` # 模拟 10秒钟 40个并发 dotnet ./src/SuperBenchmarker/bin/Debug/netcoreapp3.0/SuperBenchmarker.dll -u https://www.baidu.com -c 40 -N 10 ``` ![image.png](https://upload-images.jianshu.io/upload_images/3575048-2a255546bf05c28c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![image.png](https://upload-images.jianshu.io/upload_images/3575048-6c8bc2533d85b02f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ## 具体参数含义参考: https://github.com/aliostad/SuperBenchmarker#summary ![image.png](https://upload-images.jianshu.io/upload_images/3575048-a8d30199ce860926.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

你可能感兴趣的:(Mac 安装 SuperBenchmarker)