Skip to content

Commit

Permalink
Merge pull request #125 from yandex/release/0.3.0
Browse files Browse the repository at this point in the history
Release/0.3.0
  • Loading branch information
direvius committed May 16, 2019
2 parents 6ee3616 + bfea571 commit 691ecc4
Show file tree
Hide file tree
Showing 259 changed files with 15,394 additions and 4,348 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ _testmain.go
.goxc.local.json
.idea/
pandora.iml
*.log
*.out
out/

vendor/

docs/_*
.DS_Store
4 changes: 2 additions & 2 deletions .goxc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
],
"Arch": "amd64",
"Os": "linux darwin windows",
"PackageVersion": "0.1.2",
"PackageVersion": "0.1.3",
"TaskSettings": {
"publish-github": {
"owner": "yandex",
"repository": "pandora"
}
},
"ConfigVersion": "0.9"
}
}
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
language: go
go:
- 1.5.2
- tip

before_install:
- go get github.com/amahi/spdy
- go get golang.org/x/net/context
- go get github.com/amahi/spdy
- go get github.com/stretchr/testify
- go get github.com/SlyMarbo/spdy
- go get github.com/davecgh/go-spew/spew
- go get github.com/pquerna/ffjson
go:
- 1.11.x

env:
- GO111MODULE=on

install: make tools
go_import_path: github.com/yandex/pandora

before_install:
- mkdir $HOME/tools
- GOPATH=$HOME/tools make tools
- export PATH=$HOME/tools/bin:$PATH
- make deps

script: make travis
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ The following authors have created the source code of "Pandora"
published and distributed by YANDEX LLC as the owner:

Alexey Lavrenuke <direvius@yandex-team.ru>
Vladimir Skipor <skipor@yandex-team.ru>

The following authors have licensed their contributions to YANDEX LLC and everyone who uses "Pandora" under the licensing terms detailed in LICENSE available at https://www.mozilla.org/en-US/MPL/2.0/:

Expand Down
34 changes: 12 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.PHONY: all test lint vet fmt travis coverage checkfmt prepare updep
.PHONY: all test lint vet fmt travis coverage checkfmt prepare deps

NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
PKGSDIRS=$(shell find -L . -type f -name "*.go" -not -path "./Godeps/*")


all: test vet checkfmt

travis: test checkfmt vet coverage
travis: test checkfmt coverage

prepare: fmt test vet checkfmt #m updep
prepare: fmt test vet

test:
@echo "$(OK_COLOR)Test packages$(NO_COLOR)"
Expand All @@ -21,37 +21,27 @@ coverage:
@./script/coverage.sh
-goveralls -coverprofile=gover.coverprofile -service=travis-ci

lint:
@echo "$(OK_COLOR)Run lint$(NO_COLOR)"
test -z "$$(golint -min_confidence 0.1 ./... | grep -v Godeps/_workspace/src/ | tee /dev/stderr)"

vet:
@echo "$(OK_COLOR)Run vet$(NO_COLOR)"
@go vet ./...


checkfmt:
@echo "$(OK_COLOR)Check formats$(NO_COLOR)"
@./script/checkfmt.sh .

fmt:
@echo "$(OK_COLOR)Formatting$(NO_COLOR)"
@echo $(PKGSDIRS) | xargs -I '{p}' -n1 goimports -w {p}
@echo "$(OK_COLOR)Check fmt$(NO_COLOR)"
@echo "FIXME go fmt does not format imports, should be fixed"
@go fmt

tools:
@echo "$(OK_COLOR)Install tools$(NO_COLOR)"
go get github.com/tools/godep
go get golang.org/x/tools/cmd/goimports
go get github.com/golang/lint/golint
go get github.com/stretchr/testify
go install golang.org/x/tools/cmd/goimports
go get golang.org/x/tools/cmd/cover
go get github.com/modocache/gover
go get github.com/mattn/goveralls

updep:
@echo "$(OK_COLOR)Update dependencies$(NO_COLOR)"
GOOS=linux godep save ./...
GOOS=linux godep update github.com/...
GOOS=linux godep update gopkg.in/...
GOOS=linux godep update golang.org/...

deps:
$(info #Install dependencies...)
go mod tidy
go mod download
84 changes: 24 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,45 @@

[![Join the chat at https://gitter.im/yandex/pandora](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yandex/pandora?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/yandex/pandora.svg)](https://travis-ci.org/yandex/pandora)
[![Coverage Status](https://coveralls.io/repos/yandex/pandora/badge.svg?branch=master&service=github)](https://coveralls.io/github/yandex/pandora?branch=master)
[![Coverage Status](https://coveralls.io/repos/yandex/pandora/badge.svg?branch=develop&service=github)](https://coveralls.io/github/yandex/pandora?branch=develop)
[![Read the Docs](https://readthedocs.org/projects/yandexpandora/badge/)](https://readthedocs.org/projects/yandexpandora/)

A load generator in Go language.
Pandora is a high-performance load generator in Go language. It has built-in HTTP(S) and HTTP/2 support and you can write your own load scenarios in Go, compiling them just before your test.

## Install
Compile a binary with go tool (use go >= 1.5.2):
```
go get github.com/yandex/pandora
go build github.com/yandex/pandora
```
## How to start

There are also [binary releases](https://github.com/yandex/pandora/releases) available.
### Binary releases
[Download](https://github.com/yandex/pandora/releases) available.

Run this binary with your .json config (see [examples](https://github.com/yandex/pandora/tree/master/example/config)):
```
./pandora myconfig.json
### Building from sources
We use go 1.11 modules.
If you build pandora inside $GOPATH, please make sure you have env variable `GO111MODULE` set to `on`.
```bash
git clone https://github.com/yandex/pandora.git
cd pandora
make deps
go install
```

Or let [Yandex.Tank](https://yandextank.readthedocs.io/en/latest/core_and_modules.html#pandora) make it easy for you.


## Extension points

You can write plugins with the next [extension points](https://github.com/progrium/go-extpoints):

You can also cross-compile for other arch/os:
```
ammo.Provider
aggregate.ResultListener
limiter.Limiter
gun.Gun
GOOS=linux GOARCH=amd64 go build
```

## Build tags
### Running your tests
Run the binary with your config (see config examples at [examples](https://github.com/yandex/pandora/tree/develop/examples)):

If you don want to build pandora without http gun:
```
go build -tags 'noHttpGun' github.com/yandex/pandora
```bash
# $GOBIN should be added to $PATH
pandora myconfig.yaml
```

If you don want to build pandora without spdy gun:
```
go build -tags 'noSpdyGun' github.com/yandex/pandora
```

## Basic concepts

### Architectural scheme

See architectural scheme source in ```docs/architecture.graphml```. It was created with
[YeD](https://www.yworks.com/en/products/yfiles/yed/) editor, so you’ll probably
need it to open the file.

![Architectural scheme](/docs/architecture.png)

Pandora is made of components. Components talk to each other over the channels. There are different types of components.

### Component types

#### Ammo provider and decoder

Ammo decoder knows how to make an ammo object from an ammo file or other external resource. Ammo provider uses a decoder
to decode ammo and passes ammo objects to the Users.

#### User pool

User pool controls the creation of Users. All users from one user pool will get ammo from one ammo provider. User creation
schedule is controlled with Startup Limiter. All users from one user pool will also have guns of the same type.

#### Limiters

Limiters are objects that will put messages to its underlying channel according to a schedule. User creation, shooting or
other processes thus can be controlled by a Limiter.

#### Users and Guns
User takes an ammo, waits for a limiter tick and then shoots with a Gun it has. Guns are the tools to send a request to your
service and measure the parameters of the response.

#### Result Listener
Result listener's task is to collect measured samples and save them somewhere.
Or use Pandora with [Yandex.Tank](http://yandextank.readthedocs.org/en/latest/configuration.html#pandora) and
[Overload](https://overload.yandex.net).

0 comments on commit 691ecc4

Please sign in to comment.