A load generator in Go language.
How to start
Building from sources
We use glide for package management. Install it before compiling Pandora Compile a binary with go tool (use go >= 1.8):
go get github.com/yandex/pandora cd $GOPATH/src/github.com/yandex/pandora glide install go build
You can also cross-compile for other arch/os:
GOOS=linux GOARCH=amd64 go build
Running your tests
Run the binary with your config (see config examples at examples):
# $GOBIN should be added to $PATH pandora myconfig.yaml
pools: - id: HTTP pool # Pool name gun: type: http # Gun type target: example.com:80 # Gun target ammo: type: uri # Ammo format file: ./ammo.uri # Ammo File result: type: phout # Report format (phout is for Yandex.Tank) destination: ./phout.log # Report file name rps: # RPS Schedule type: periodic # shoot periodically period: 0.1s # ten batches each second max: 30 # thirty batches total batch: 2 # in batches of two shoots startup: # Startup Schedule type: periodic # start Instances periodically period: 0.5s # every 0.5 seconds batch: 1 # one Instance at a time max: 5 # five Instances total
Run your tests:
See architectural scheme source in
docs/architecture.graphml. It was created with
Pandora is a set of components talking to each other through the channels. There are different types of components.
Ammo Provider knows how to make an ammo object from an ammo file or other external resource. Instances get ammo objects from Ammo Provider.
Instances Pool manages the creation of Instances. You can think of one Instance as a single user that sends requests to a server sequentially. All Instances from one Instances Pool get their ammo from one Ammo Provider. Instances creation times are controlled by Startup Scheduler. All Instances from one Instances Pool also have Guns of the same type.
Scheduler controls other events' times by pushing messages to its underlying channel according to the Schedule. It can control Instances startup times, RPS amount (requests per second) or other processes.
By combining two types of Schedulers, RPS Scheduler and Instance Startup Scheduler, you can simulate different types of load. Instace Startup Scheduler controls the level of parallelism and RPS Scheduler controls throughput.
If you set RPS Scheduler to 'unlimited' and then gradually raise the number of Instances in your system by using Instance Startup Scheduler, you'll be able to study the scalability of your service.
If you set Instances count to a big, unchanged value (you can estimate the needed amount by using Little's Law) and then gradually raise the RPS by using RPS Scheduler, you'll be able to simulate Internet and push your service to its limits.
You can also combine two methods mentioned above. And, one more thing, RPS Scheduler can control a whole Instances Pool or each Instance individually.Schedule types
Shoot in batches with fixed intervals. Parameters:
period– interval between batches, example:
0.1s– 10 batches in a second
batch– batch size, default:
max– total number of batches, default:
RPS (requests per second) will grow linearly during test.
duration– schedule part duration
start-rps– RPS on the left side of the schedule
end-rps– RPS on the right side of the schedule
Produces ticks without any limits.
Instances and Guns
Instances takes an ammo, waits for a Scheduler tick and then shoots with a Gun it has. Gun is a tool that sends a request to your service and measures the parameters (time, error codes, etc.) of the response.
Aggregator collects measured samples and saves them somewhere.
There is no documentation for this package.
package phttp (pandora http) contains pandora extension points for HTTP related protocols.
|package phttp (pandora http) contains pandora extension points for HTTP related protocols.|
Code generated by mockery v1.0.0
|Code generated by mockery v1.0.0|
package core defines pandora engine extension points.
|package core defines pandora engine extension points.|
Package config provides advanced framework to decode and validate configuration structs.
|Package config provides advanced framework to decode and validate configuration structs.|
package coreutil provides utilities for core interfaces, that can be useful not only for engine, but other core importers too.
|package coreutil provides utilities for core interfaces, that can be useful not only for engine, but other core importers too.|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
|Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0|
Package plugin provides a generic inversion of control model for making extensible Go packages, libraries, and applications.
|Package plugin provides a generic inversion of control model for making extensible Go packages, libraries, and applications.|
Package pluginconfig contains integration plugin with config packages.
|Package pluginconfig contains integration plugin with config packages.|
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
|Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0|