pandora

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2017 License: MPL-2.0 Imports: 5 Imported by: 0

README

Pandora

Build Status Coverage Status

A load generator in Go language.

How to start

Binary releases

Download available.

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

Or use Pandora with Yandex.Tank and Overload.

Example

load.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

ammo.uri:

/my/first/url
/my/second/url

Run your tests:

pandora load.yaml

The results are in phout.log. Use Yandex.Tank and Overload to plot them.

Basic concepts

Architectural scheme

See architectural scheme source in docs/architecture.graphml. It was created with YeD editor.

Architectural scheme

Pandora is a set of components talking to each other through the channels. There are different types of components.

Component types
Ammo Provider

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

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

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

periodic

Shoot in batches with fixed intervals. Parameters:

  • period – interval between batches, example: 0.1s – 10 batches in a second
  • batch – batch size, default: 1
  • max – total number of batches, default: unlimited

linear

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

unlimited

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

Aggregator collects measured samples and saves them somewhere.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
components
phttp
package phttp (pandora http) contains pandora extension points for HTTP related protocols.
package phttp (pandora http) contains pandora extension points for HTTP related protocols.
phttp/mocks
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.
config
Package config provides advanced framework to decode and validate configuration structs.
Package config provides advanced framework to decode and validate configuration structs.
coreutil
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.
mocks
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
plugin
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.
plugin/pluginconfig
Package pluginconfig contains integration plugin with config packages.
Package pluginconfig contains integration plugin with config packages.
lib
netutil/mocks
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
tag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL