Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crossoverjie/ptg
💥Performance testing tool (Go), It is also a GUI gRPC client.
https://github.com/crossoverjie/ptg
benchmark golang grpc grpc-client grpc-gui http performance-testing
Last synced: 8 days ago
JSON representation
💥Performance testing tool (Go), It is also a GUI gRPC client.
- Host: GitHub
- URL: https://github.com/crossoverjie/ptg
- Owner: crossoverJie
- Created: 2021-10-11T15:32:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-11T05:42:42.000Z (over 2 years ago)
- Last Synced: 2024-10-20T04:59:24.898Z (19 days ago)
- Topics: benchmark, golang, grpc, grpc-client, grpc-gui, http, performance-testing
- Language: Go
- Homepage: https://crossoverjie.top/2021/11/28/go/go-grpc-client-gui/
- Size: 5.7 MB
- Stars: 331
- Watchers: 11
- Forks: 37
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-grpc - ptg - GUI gRPC client, it is also a performance testing tool. (Tools / GUI)
README
# ptg
Performance testing tool (Go), It is also a **GUI** `gRPC` client.Test the `gRPC` service like `postman`.
![](pic/show.gif)
![](pic/ptg.gif)
![](pic/search.gif)More screenshot
# Features
- [x] CLI performance test support.
- [x] GUI support.
- [x] Metadata support.
- [x] Data persistence.
- [x] Search history.
- [X] Stream call.
- [ ] Benchmark GUI.# Install
## CLI app
```go
go get github.com/crossoverJie/ptg
``````shell script
wget https://github.com/crossoverJie/ptg/releases/download/${version}/ptg-${os}-${version}.tar.gz
```## GUI app
To download the installer, go to the [Releases Page](https://github.com/crossoverJie/ptg/releases).
## Build from source
```shell
git clone [email protected]:crossoverJie/ptg.git
cd ptg
make release
make pkg-win
make pkg-macos
```# Usage
```shell script
NAME:
ptg - Performance testing tool (Go)USAGE:
ptg [global options] command [command options] [arguments...]COMMANDS:
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--thread value, -t value -t 10 (default: 1 thread)
--Request value, --proto value -proto http/grpc (default: http)
--protocol value, --pf value -pf /file/order.proto
--fully-qualified value, --fqn value -fqn package.Service.Method
--duration value, -d value -d 10s (default: Duration of test in seconds, Default 10s)
--request value, -c value -c 100 (default: 100)
--HTTP value, -M value -m GET (default: GET)
--bodyPath value, --body value -body bodyPath.json
--header value, -H value HTTP header to add to request, e.g. "-H Content-Type: application/json"
--target value, --tg value http://gobyexample.com/grpc:127.0.0.1:5000
--help, -h show help (default: false)
```
## http
```shell script
ptg -t 20 -d 10 -proto http -tg "http://gobyexample.com"
```Benchmark test for 10 seconds, using 20 goroutines.
output:
```shell script
Requesting: http://gobyexample.com <---------------> 1 p/s 100.00%43 requests in 10 seconds, 13.88MB read.
Avg Req Time: 358.512071ms
Fastest Request: 93.518704ms
Slowest Request: 840.680771ms
Number of Errors: 0
```> POST example
```shell script
ptg -t 2 -proto http -c 2 -M POST -H "Content-Type: application/json" -body test.json -tg "http://xx/create"
```## gRPC(unary call)
```shell script
ptg -t 10 -c 100 -proto grpc -pf /xx/xx.proto -fqn hello.Hi.Say -body test.json -tg "127.0.0.1:5000"
```output:
```shell script
thread: 10, duration: 0, count 100
Requesting: 127.0.0.1:5000 <---------------> 102 p/s 100.00%
100 requests in 11 seconds, 230.6kB read, and cost 1 second.
Avg Req Time: 116.602652ms
Fastest Request: 111.563179ms
Slowest Request: 128.587886ms
Number of Errors: 0
```# Acknowledgements
- [go-wrk](https://github.com/tsliwowicz/go-wrk)
- [bloomrpc](https://github.com/bloomrpc/bloomrpc)