Giter Site home page Giter Site logo

pandora's People

Contributors

antonydevanchi avatar arcadia-devtools avatar digrinch avatar direvius avatar formatcvt avatar georgthegreat avatar gitter-badger avatar griddic avatar guspan-tanadi avatar igorperikov avatar inesusvet avatar justskiv avatar ligreen avatar m0sth8 avatar nickclmb avatar nnugumanov avatar notanonymousenough avatar oke11o avatar psydvl avatar rapthead avatar robot-piglet avatar serejkus avatar shadchin avatar skipor avatar snermolaev avatar tonsofattraction avatar trueival avatar vanyarock01 avatar vitaminniy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pandora's Issues

netsample binary Aggregator

First line: json metadata. Format like:

format: binary
date: 20-03-2017 20:17:53.122
type: response_stat
columns:
  - name: ts
    type: float64
  - name: urt
    type: int64
config: 
   pools:
     - id: 
     ....

Than print fields as is in big endian. One sample per line.

Extremely strict rules for uri ammo files

Please, just ignore the spaces instead of stopping the test:
Pool failed. Canceling started tasks {"pool": "pool_0", "error": "provider faile d: failed to decode ammo at line: 1; data: \"[Accept-Encoding: gzip,deflate,sdch] \": header line should be like '[key: value]\n

Pass common dependencies to core plugins

Pass core.Deps struct to Aggregator, Provider and Gun as an arg to their Run (Bind) methods.

What put to core.Deps:
1). zap.Logger
2) some metrics registry. I think something custom based on go-metrics
3) registry, to register what will be logged as every second shooting status
4) afero.Fs? Not shure really.
Document, that some fields may be added in future versions.

core.DataSource plugin

We want go use different data sources for Providers, but not create multiple providers with same decoding logic.
Proposed, to create core.DataSource plugin, that will contain logic of getting encoded ammo bytes, and use it as nested plugin in Providers that takes bytes from somewhere and decodes them.

Here some draft:

type DataSource {
    // Open opens data source. 
    // Returned source can be file, socket, string or byte reader, or anything else, that implements
    // more that io.Reader, so it's ok to check if source is io.Seeker, and seek if it is.
    // Specific type checking (*os.File, for example) highly not recommended - use interfaces.
    Open() (source io.Closer, err error)
}

What DataSources can be implemented:

  • file (filepath to open)
  • socket (some string, that can be passed to net.Listen)
  • url (http/https URL to download)
  • inline (string inlined to config)

Advanced configuration and extension

Use configuration by spf13/viper + mitchellh/mapstructure to:

  • get rid of manual map[string]interface{} decode in extpoints fabric functions
  • support multiple configuration formats ( json, yaml, ...) for free
  • case insensitive names
  • decode hooks

Use go-playground/validate for config-parse time validation.

Also consider to make plugin creation easy like:

package custom_gun
type Gun struct { config Config}
var _ pandora.Gun = (*Gun)(nil)
type Config { Target string `validate:"hostname"` }
func New(config * Config) *Gun {  return &Gun{config} }

init () { pandora.RegisterGun( New, "my_gun") }

Of course that requires some reflect based magic.

Error in console in the end of a test

Error waiting utils promises: 1 error(s) occurred:

* context canceled2017/06/23 21:11:00 Done

Config:

pools:
  - id: HTTP pool                    # Pool name
    gun:
      type: http                     # Gun type
      target: [my-host-here]:80  # Gun target
    ammo:
      type: uri                      # Ammo format
      file: ./ammo.uri               # Ammo File
    result:
      type: phout                    # Report format (phout is for Yandex.Tank)
      destination: ./http_phout.log  # Report file name
    rps:                             # RPS Schedule
      type: periodic                 # tick periodically
      batch: 1                       # in batches of two ticks
      max: 300                         # three batches total
      period: 0.1s                     # one batch each second
    startup:                         # Startup Schedule
      type: periodic                 # start Instances periodically
      batch: 1                       # one Instance at a time
      max: 5                         # five Instances total
      period: 0.5s                   # every 0.5 seconds

Ammo:

/

Pareto schedule

Add schedule with Pareto distributed inter-arrival times. May be support other distributions.

Extra ammo consumed at instance schedule finish

Instance takes ammo before schedule token take, that allows be ready, when take next schedule token, and operate close to schedule.
But in case of individual schedules, extra ammo will be taken.

Propose add IsFinished() bool schedule method, that allows check is schedule finished before taking ammo.

In such case, in case of shared schedule, some extra ammos can be consumed anyway at schedule finish, but that is minor problem - that will happen once after shooting finish.

Refactor limiters

  • use Timer and Timer.Reset instead of After
  • implement Periodic limiter using Timer instead of Ticker
  • don't use channels for limiters composition

Basic idea: generate timestamps with a function and use them to drive the Timer.

Headers in config file for URI-style http ammo

Add Headers config parameter for URI-style http ammo.

Now we can specify headers in ammo file, but there are cases when we want to use same ammo file with different headers. It would be convenient not to regenerate whole file.

See also: #60 #52

Make sample reporting non blocking

From Aggregator doc:

// If Aggregator can't process reported sample without blocking, it should just throw it away.
// If any reported samples were thrown away, Run should return error describing how many samples
// were thrown away.

We should implement that behaviour in all existing Aggregators.

Use glide for package management

Glide is most powerful package manager.
It supports aliasing packages (e.g. for working with github forks) and many other things

Get rid of /vendor folder

Pandora repo designed to be used as library, as well as binary.
But /vendor folder cause compilation error, when Pandora used ad library.
I propose to get rid of /vendor folder, but remain glide.lock and glide.yaml files, and use them to have reproducible builds in CI.

HTTP2 gun

Now HTTP gun allows HTTP/2, but this behavior is too implicit.
Create explicit HTTP/2 gun, and forbid HTTP/2 for HTTP gun.

Acceptance testing

Need to automate compile and run of Pandora binary and check its behaviour. It would be great to check it before every PR in CI.
Propose:
Create acceptance_tests directory and create onsi/gomega/gexec driven tests for

  • CLI behaviour
  • Main plugins behaviour

I imagine tests like

  • Before suite: compile binary via onsi/gomega/gexec
  • Some test
    • launch httptest.Server and run binary against testdata/http.yaml config
    • Check pandora log output (for data races end errors, for example) and return code.
  • Other tests

Parallelism option

Make parallelism option in config, with 1 value by default.
When parallelism is more that one, instances should call Gun.Shoot in separate goroutine, using maximum parallelism in parallel.

That option will be very helpful for http2 gun.

Collect and publish generator status

Collect and publish generator status metrics such as parallel requests count, ammo loop count, users count and others. Publish every n seconds, n should be configurable.
Every plugin (gun, user, etc) should be able to publish its metrics in a common way.

Fast leveled logging

Get rid of stdlib logger, and use something leveled and fast. I suggest uber-go/zap.
At degug level, logs should include:

  • requests
  • responses
  • internal actions
    • user start/finish
    • composite limiter steps
    • etc.

Update readme

Link to examples is broken.
Also I got this error if startup section configured to linear type (as suggested in config):

cli/cli.go:101	Config decode failed	{"error": "1 error(s) decoding:\n\n* error decoding 'pools[0].startup': no plugins of type core.Schedule has been registered for name linear"

JSON and MessagePack reflect aggregators & providers

JSON and MessagePack are fast enough, and supported widely.
Such modules will be nice for quick implementations.
When performance become problem, it will be easy to replace reflect version with fast code generated.

TLS features like

Would be nice to have configurable options for cipher_suits and SNI in pandora

Plugin type defaults

Every plugin implementation can have it's own defaults. But user still needed to set 'type' field for every plugin.
I propose to add default types for every plugin.

Clear way to use one aggregator in multiple pools

Usually, even when using multiple instance pools, wanted to use one Aggregator for them.
Now, phout aggregator solving this problem in not clear way: aggregator config passed to all needed places, but underhood only aggregator created, but many Run routines started. And seems, that there are some bugs in this non clear implementation.

I propose add explicit mechanism to use one aggregator in multiple pools.
How I think it should be looking in config:

pools:
  - ...
    aggregator: 
      type: master
      # key: some_key # "default" by default, so should not be typed when only master created.
      config:
        type: phout
        ....
  - ...
    aggregator:
      - type: slave
       # key: some_key # "default" by default, so should not be typed when only master created.

Master and slaves use one global registry, where found each other config key.
Only master runs real aggregator background routine, and it's context should not be canceled until master and all slaves context cancel. Context values passed from master context.

Slave aggregator instance should just block until context cancel, or master subroutine finished

Ammo enumeration

Implement a flag in config that will switch on/off ammo enumeration. Each ammo will have a number after # sign in tag:

_my_tag#33

Abstract HTTP ammo

Make HTTP ammo something like

type HTTP interface {
    GetRequest() (*http.Request, SmthElse)
}

That allows easily use different ammo sources with different http based guns.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.