README
¶
Otchkiss
Features
Otchkiss is a simple load testing library.
- Easy to make single node load testing.
- Easy to display result some statistics by default format.
- Flexible displaying results by user template.
Usage
go get github.com/ryo-yamaoka/otchkiss
See ./sample/main.go for a sample implementation.
[Setting]
* warm up time: 3s
* duration: 3s
* max concurrent: 0
* max RPS: 0
[Request]
* total: 25
* succeeded: 25
* failed: 0
* error rate: 0 %
* RPS: 8.3
[Latency]
* max: 800.0 ms
* min: 1.0 ms
* avg: 390.0 ms
* med: 400.0 ms
* 99th percentile: 700.0 ms
* 90th percentile: 600.0 ms
[Histogram]
0s-88.888888ms 4% █████▏ 1
88.888888ms-177.777777ms 8% ██████████▏ 2
177.777777ms-266.666666ms 12% ███████████████▏ 3
266.666666ms-355.555555ms 16% ████████████████████▏ 4
355.555555ms-444.444444ms 20% █████████████████████████▏ 5
444.444444ms-533.333333ms 16% ████████████████████▏ 4
533.333333ms-622.222222ms 12% ███████████████▏ 3
622.222222ms-711.111111ms 8% ██████████▏ 2
711.111111ms-800ms 4% █████▏ 1
Command line options
When you useing otchkiss.New()
or setting.FromDefaultFlag()
, will be parsed following command line parameters.
This eliminates the need to write the parsing process.
-p
: Specify the number of parallels executions.0
means unlimited (default:1
, it's not concurrently)-d
: Running duration, ex: 300s or 5m etc... (default:5s
)-w
: Exclude from results for a given time after startup, ex: 300s or 5m etc... (default:5s
)-r
: Specify the max request per second. 0 means unlimited (default:1
)
Development
- Lint:
make lint
- install lint tools:
make install-tools
- install lint tools:
- Test:
make test
Author
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Otchkiss ¶
func FromConfig ¶
func FromConfig(requester Requester, setting *setting.Setting, resultCapacity int) (*Otchkiss, error)
FromConfig returns Otchkiss instance by user specified setting. Too large values for resultCapacity may cause OOM (FYI: default value is 100M).
func New ¶
New returns Otchkiss instance with default setting. By default, the following three command line arguments are parsed and set.
-p: Specify the number of parallels executions. 0 means unlimited (default: 1, it's not concurrently) -d: Running duration, ex: 300s or 5m etc... (default: 5s) -w: Exclude from results for a given time after startup, ex: 300s or 5m etc... (default: 5s) -r: Specify the max request per second. 0 means unlimited (default: 1)
Note: -p or -r, whichever is smaller blocks the request.
type ReportParams ¶
type Requester ¶
type Requester interface { // Init is executed only once before the repeated RequestOne loop. // If initialization is unnecessary, do nothing and return nil. Init() error // RequestOne is executed repeatedly and in parallel. // Normally HTTP, gRPC, and other requests are written here. // If an error is returned the request is counted as a failure; otherwise, it is counted as a success. RequestOne(ctx context.Context) error // Terminate is executed only once after the repeated RequestOne loop. // If termination is unnecessary, do nothing and return nil. Terminate() error }
Requester defines the behavior of the request that Otchkiss performs.