influxdb/stress/README.md

48 lines
2.1 KiB
Markdown
Raw Normal View History

Refactor stress tool Add StressTest type and auxillary interfaces Add config structs Move generator to config Add utility methods used in stress Add basic components for a stress test Add touches Add configuration options Add unified results handlers Add final print out of results Add Success function to response type Add query support Send query results Add comments to run.go Change Basic to BasicWriter Add basic query Add incomplete README Abstract out response handling Change plugin to basic Add responseHandler type Add additional parameter to Query function Add todo comments and cleanup main Lower hard coded value Add flag for profiling Fix race condition Wait at the right place Chane point from struct to interface Improve generic write throughput Reorganize Fastest State Add toml config Add test server Add basic working version of config file Move config file logic into its own file Fix broken config file Add query count to stress config Add support for concurrency and batch interval Reorder config option Remove unneeded init Remove old stress package Move new stress code into stress directory Rework influx_stress tool Do something reasonable if no config is given Remove unneeded comments Add tests for stress package Add comments and reorganize code Add more comments Count lines posted correctly Add NewConfig method Fix style issues Add backticks to flag description Fix grammar Remove `StartTimer` calls where appropriate Fix comment language Change Reader to Querier Reorder defer Fix issues bought up by golint Add more comments Add more detailed Readme Increase counter appropriately Add return errors where appropriate Add test coverage Move `now()` from QueryClient to QueryGenerator
2015-11-02 19:50:39 +00:00
## Stress Test
The logic for `StressTest` can be found in `stress/run.go`.
A new `StressTest` type was added and is composed four different parts. The `StressTest` type has one method `Start(wHandle responseHandler, rHandle responseHandler)`. This method starts the stress test.
A `responseHandler` is a function with type signature `func(r <-chan response, t *Timer)`. Response Handlers handle the read and write responses respectively.
### Provisioner
Provisions the InfluxDB instance where the stress test is going to be ran against.
Think things like, creating the database, setting up retention policies, continuous queries, etc.
### Writer
The `Writer` is responsible for Writing data into an InfluxDB instance. It has two components: `PointGenerator` and `InfluxClient`.
##### PointGenerator
The `PointGenerator` is responsible for generating points that will be written into InfluxDB. Additionally, it is reponsible for keeping track of the latest timestamp of the points it is writing (Just incase the its needed by the `Reader`).
Any type that implements the methods `Generate()` and `Time()` is a `PointGenerator`.
##### InfluxClient
The `InfluxClient` is responsible for writing the data that is generated by the `PointGenerator`.
Any type that implements `Batch(ps <-chan Point, r chan<- response)`, and `send(b []byte) response` is an `InfluxClient`.
### Reader
The `Reader` is responsible for querying the database. It has two components: `QueryGenerator` and `QueryClient`.
##### QueryGenerator
The `QueryGenerator` is responsible for generating queries.
##### QueryClient
The `QueryClient` is responsible for executing queries against an InfluxDB instance.
## Basic
`basic.go` implements an each of the components of a stress test.
## Util
`util.go` contains utility methods used throughout the package.
## Config
`config.go` contains the logic for managing the configuration of the stress test.
A sample configuration file can be found in `stress/stress.toml`. This still needs work, but whats there now is good enough IMO.
## Template
`template.go` contains the logic for a basic stress test.