• Stars
    star
    161
  • Rank 232,367 (Top 5 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Web api management and performance testing tools

Web api benchmark

说到WebApi管理和测试工具其实已经非常多的了,Postman、Swagger等在管理和维护上都非常出色;在性能测试方面也有不少的工具如:wrk,bombardier,http_load和ab等等。不过这些工具都具有单一性,管理和维护好的在性能测试上比较低效,对于性能测试好的在管理和维护上不理想!以下主要介绍一款基于dotnet core开发的WebApiBenchmarks工具,这个工具可以对webapi进行管理和维护并提供高效的性能测试能力,接下来来先预览一下这个小工具再进行详细介绍。

docker

docker pull ikende/beetlex_webapi_benchmark:v0.8.6
http://host:9090/

0.8.2

header不进行url编码,非80端口的host添加相应端口

0.7

添加测试用例名称,优先显示名称;添加返回结果json格式化;添加导出和导入功能;

0.6.8

调整测试用例树刷新问题,添加状态明细查看,修复测试后没有释放连接问题

0.6

添加明细百分比显示

功能

  • 支持简单的服务管理,可以随时对不同服务的API进行单元和压力测试
  • 支持分类的方式管理测试用例,用例支持定义GET,POST,DELETE和PUT等操作的定义
  • 提供高效的性能测试支持,在4核的PC上可以达到200k rps的测试效能;
  • 支持多API同时压测,并显示相关性能指标数据进行参考和对比

部署

工具可以运行在安装有.net core 2.1或更高版本的Linux和Windows下,工具以http服务的方式启动,通过浏览器访问进行相关操作。

运行

  • linux
dotnet BeetleX.WebApiBenchmarks.dll

or

./webapibenchmark.sh
  • windows
dotnet BeetleX.WebApiBenchmarks.dll

or

webapibenchmark.bat

端口冲突

工具默认使用9090端口,如果端口被占则无法启用服务,这个时候需要修改HttpConfig.json文件中的端口配置

    "Host": "",
    "Port": 9090,
    "SSL": false,

打开工具

工具运行后可以浏览器访问相关地址打开工具,本机访问http://localhost:9090/其他电脑访问http://ipaddress:9090/

添加服务地址

工具可以维护多个服务地址,所有的测试都必须选择对应的地址才能运行测试。

地址必须是一个可用的http服务Url

添加测试用例

工具支持GET,POST,DELETE和PUT请求定义,可以根据实际情况定义QueryString和Header值,并针对POST和PUT设置相应的Body内容。具体操作界面如下:

在编辑界面下面有个测试按钮,可以即刻测试API的调用情况;选择相应的服务地址点击测试即可在下方看到完整的返回结果:

批量单元测试

工具支持批量执行测试用例,并在测试用例上显示具体的执行结果;只要选择需要测试的用例点击单元测试即可:

性能测试

性能测试是组件提供的最重要功能,为了确保性能测试的效率;组件重写了一个轻量化的HttpClient,通过这个HttpClient即使在低配置的电脑上也可以进行高效率的压力测试。测试前需要选择相应的服务地址和单元测试用例

测试参数设置

工具提供两种测试方式,分别是基于时间和总请求数据,选择对应的测试方式设置相应的测试数值即可;用户数是指同时请求的数量,工具限制设置最大2000,设置完成后点击开始按钮即可进行测试

测试结果

工具会实时反映测试的情况,主要包括HTTP响应状态和响应延时分布情况,如果同时压测多个API,则明细里会实时显示每个API的响应状态和响应延时情况。具体如下:

More Repositories

1

BeetleX

high performance dotnet core socket tcp communication components, support TLS, HTTP, HTTPS, WebSocket, RPC, Redis protocols, custom protocols and 1M connections problem solution
C#
1,098
star
2

FastHttpApi

a lightweight and high-performance http/websocket service component in the dotnet core platform that supports TLS.
C#
640
star
3

Bumblebee

.net core fast http and websocket gateway components
C#
351
star
4

XBlog

Personal blog websites system built on Beetlex.FastHttpApi framework
JavaScript
204
star
5

Beetle.DT

分布式压力测试工具
C#
190
star
6

BeetleX.Redis

A high-performance async/non-blocking redis client components for dotnet core,default data formater json protobuf and messagepack,support ssl
C#
185
star
7

TCPBenchmarks

tcp,websocket,webapi性能测试工具
117
star
8

BeetleX-Samples

BeetleX micro services framework (tcp webapi websocket and xrpc) samples
C#
102
star
9

SmartRoute

SmartRoute(服务即集群)
C#
84
star
10

XRPC

dotnet high performance remote interface and delegate invoke(RPC) communication components,support millions RPS remote interface method invokes
C#
80
star
11

Log4Grid

Distributed Application Log Management
C#
42
star
12

EventNext

EventNext is logic interface design actors components for .net core
C#
41
star
13

WebBenchmark

webapi 管理和性能测试工具
39
star
14

HttpClients

BeetleX http/websocket client support ssl
C#
31
star
15

ec

elastic communication component for mono and .net
C#
29
star
16

BNR

业务流水号规则生成器
C#
26
star
17

SimpleDoc

轻量化在线文档发布服务
CSS
24
star
18

KFilter

脏字过虑组件
C#
23
star
19

downloads

beetlex应用服务下载:网关,VueHost,性能测试工具和大数据分析服务
21
star
20

AdminUI

Beetlex+Vuejs+Bootstrap admin ui website
Vue
20
star
21

CacheDB

C#
18
star
22

NetBenchmark

tpc http and websocket performance benchmark testing components
C#
18
star
23

ClusterConfiguration

Beetlex Webapi cluster configuration
HTML
14
star
24

BeetleX.EFCore.Extension

BeetleX.EFCore.Extension
C#
14
star
25

dotnet-rpc-benchmark

rpc component benchmarks for dotnet
C#
14
star
26

CodeBenchmarkDoc

concurrent test components for netstandard 2.0
C#
11
star
27

WebFamily

Beetlex快速Web开发框架,内置vue,element,fontawesome
JavaScript
11
star
28

WebAPI4Grid

WebAPI集群负载组件
C#
8
star
29

ConcurrentTest

Concurrent Testing
C#
8
star
30

SmartRoute.DLocks

SmartRoute分布式锁
C#
8
star
31

RazorEngine

RazorEngine
C#
7
star
32

Configuration4Net

远程配置文件加载组件
C#
7
star
33

IKendeCLI

command line parse for .net
7
star
34

Peanut

c#数据访问组件
C#
6
star
35

Doc

Beetlex相关组件使用文档
6
star
36

vue-autoui

vue-autoui
JavaScript
6
star
37

beetlex-io

5
star
38

CS4Script

c#动态脚本编译加载组件
C#
3
star
39

SmartRoute.MRC

Message routing center
C#
3
star
40

BeetleXjs

beetlex webapi基于vue的快速开发扩展
Vue
2
star
41

mqtt

high performance .NET library for MQTT based communication
C#
2
star