{"action":"created","issue":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/4742","labels_url":"https://api.github.com/repos/influxdb/influxdb/issues/4742/labels{/name}","comments_url":"https://api.github.com/repos/influxdb/influxdb/issues/4742/comments","events_url":"https://api.github.com/repos/influxdb/influxdb/issues/4742/events","html_url":"https://github.com/influxdb/influxdb/pull/4742","id":116240462,"number":4742,"title":"WIP: Refactor Stress tool","user":{"login":"mjdesa","id":1477539,"avatar_url":"https://avatars.githubusercontent.com/u/1477539?v=3","gravatar_id":"","url":"https://api.github.com/users/mjdesa","html_url":"https://github.com/mjdesa","followers_url":"https://api.github.com/users/mjdesa/followers","following_url":"https://api.github.com/users/mjdesa/following{/other_user}","gists_url":"https://api.github.com/users/mjdesa/gists{/gist_id}","starred_url":"https://api.github.com/users/mjdesa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjdesa/subscriptions","organizations_url":"https://api.github.com/users/mjdesa/orgs","repos_url":"https://api.github.com/users/mjdesa/repos","events_url":"https://api.github.com/users/mjdesa/events{/privacy}","received_events_url":"https://api.github.com/users/mjdesa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/influxdb/influxdb/labels/2%20-%20Working","name":"2 - Working","color":"CCCCCC"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-11T01:18:26Z","updated_at":"2015-11-11T01:19:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/influxdb/influxdb/pulls/4742","html_url":"https://github.com/influxdb/influxdb/pull/4742","diff_url":"https://github.com/influxdb/influxdb/pull/4742.diff","patch_url":"https://github.com/influxdb/influxdb/pull/4742.patch"},"body":"# Stress tool refactor\r\n## Stress Test\r\nThe logic for `StressTest` can be found in `stress/run.go`.\r\n\r\nA 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.\r\n\r\nA `responseHandler` is a function with type signature `func(r <-chan response, t *Timer)`. Response Handlers handle the read and write responses respectively.\r\n\r\n### Provisioner\r\nProvisions the InfluxDB instance where the stress test is going to be ran against.\r\n\r\nThink things like, creating the database, setting up retention policies, continuous queries, etc.\r\n\r\n### Writer\r\nThe `Writer` is responsible for Writing data into an InfluxDB instance. It has two components: `PointGenerator` and `InfluxClient`.\r\n\r\n##### PointGenerator\r\nThe `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`).\r\n\r\nAny type that implements the methods `Generate()` and `Time()` is a `PointGenerator`.\r\n\r\n##### InfluxClient\r\nThe `InfluxClient` is responsible for writing the data that is generated by the `PointGenerator`.\r\n\r\nAny type that implements `Batch(ps <-chan Point, r chan<- response)`, and `send(b []byte) response` is an `InfluxClient`.\r\n\r\n### Reader\r\nThe `Reader` is responsible for querying the database. It has two components: `QueryGenerator` and `QueryClient`.\r\n\r\n##### QueryGenerator\r\nThe `QueryGenerator` is responsible for generating queries.\r\n\r\n##### QueryClient\r\nThe `QueryClient` is responsible for executing queries against an InfluxDB instance.\r\n\r\n## Basic\r\n`basic.go` implements an each of the components of a stress test.\r\n\r\n## Util\r\n`util.go` contains utility methods used throughout the package.\r\n\r\n## Config\r\n`config.go` contains the logic for managing the configuration of the stress test.\r\n\r\nA sample configuration file can be found in `stress/stress.toml`. This still needs work, but whats there now is good enough IMO.\r\n\r\n## Template\r\n`template.go` contains the logic for a basic stress test.\r\n\r\n## Todo\r\n\r\n- [ ] Write tests\r\n- [ ] Expand `influx_stress` functionality and configurability\r\n- [ ] General code cleanup\r\n- [ ] Expand Readme"},"comment":{"url":"https://api.github.com/repos/influxdb/influxdb/issues/comments/155623100","html_url":"https://github.com/influxdb/influxdb/pull/4742#issuecomment-155623100","issue_url":"https://api.github.com/repos/influxdb/influxdb/issues/4742","id":155623100,"user":{"login":"mjdesa","id":1477539,"avatar_url":"https://avatars.githubusercontent.com/u/1477539?v=3","gravatar_id":"","url":"https://api.github.com/users/mjdesa","html_url":"https://github.com/mjdesa","followers_url":"https://api.github.com/users/mjdesa/followers","following_url":"https://api.github.com/users/mjdesa/following{/other_user}","gists_url":"https://api.github.com/users/mjdesa/gists{/gist_id}","starred_url":"https://api.github.com/users/mjdesa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjdesa/subscriptions","organizations_url":"https://api.github.com/users/mjdesa/orgs","repos_url":"https://api.github.com/users/mjdesa/repos","events_url":"https://api.github.com/users/mjdesa/events{/privacy}","received_events_url":"https://api.github.com/users/mjdesa/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T01:19:34Z","updated_at":"2015-11-11T01:19:34Z","body":"@otoolep "}}