Documentation ¶
Index ¶
- type ConcurrencyLimiter
- type Directive
- type Package
- type Response
- type StressTest
- func (st *StressTest) GetPoint(name, precision string) models.Point
- func (st *StressTest) GetStatementResults(sID, t string) (res []influx.Result)
- func (st *StressTest) NewResultsPointBatch() influx.BatchPoints
- func (st *StressTest) SendDirective(d Directive)
- func (st *StressTest) SendPackage(p Package)
- func (st *StressTest) SetCommune(name string) chan<- string
- type Tracer
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrencyLimiter ¶
ConcurrencyLimiter ensures that no more than a specified max number of goroutines are running.
func NewConcurrencyLimiter ¶
func NewConcurrencyLimiter(max int) *ConcurrencyLimiter
NewConcurrencyLimiter returns a configured limiter that will ensure that calls to Increment will block if the max is hit.
func (*ConcurrencyLimiter) Decrement ¶
func (c *ConcurrencyLimiter) Decrement()
Decrement will reduce the count of running goroutines by 1
func (*ConcurrencyLimiter) Increment ¶
func (c *ConcurrencyLimiter) Increment()
Increment will increase the count of running goroutines by 1. if the number is currently at the max, the call to Increment will block until another goroutine decrements.
func (*ConcurrencyLimiter) NewMax ¶
func (c *ConcurrencyLimiter) NewMax(i int)
NewMax resets the max of a ConcurrencyLimiter.
type Directive ¶
Directive is a struct to enable communication between SetStatements and the stressClient backend Directives change state for the stress test
type Package ¶
Package is a struct to enable communication between InsertStatements, QueryStatements and InfluxQLStatements and the stressClient backend Packages carry either writes or queries in the []byte that makes up the Body
type Response ¶
Response holds data scraped from InfluxDB HTTP responses turned into a *influx.Point for reporting See reporting.go for more information The Tracer contains a wait group sent from the statement. It needs to be decremented when the Response is consumed
func NewResponse ¶
NewResponse creates a new instance of Response
type StressTest ¶
type StressTest struct { TestID string TestDB string Precision string StartDate string BatchSize int sync.WaitGroup sync.Mutex ResultsChan chan Response ResultsClient influx.Client // contains filtered or unexported fields }
The StressTest is the Statement facing API that consumes Statement output and coordinates the test results
func NewStressTest ¶
func NewStressTest() *StressTest
NewStressTest creates the backend for the stress test
func NewTestStressTest ¶
func NewTestStressTest() (*StressTest, chan Package, chan Directive)
NewTestStressTest returns a StressTest to be used for testing Statements
func (*StressTest) GetPoint ¶
func (st *StressTest) GetPoint(name, precision string) models.Point
GetPoint is called by a QueryStatement and retrieves a point sent by the associated InsertStatement
func (*StressTest) GetStatementResults ¶
func (st *StressTest) GetStatementResults(sID, t string) (res []influx.Result)
GetStatementResults is a convinence function for fetching all results given a StatementID
func (*StressTest) NewResultsPointBatch ¶
func (st *StressTest) NewResultsPointBatch() influx.BatchPoints
NewResultsPointBatch creates a new batch of points for the results
func (*StressTest) SendDirective ¶
func (st *StressTest) SendDirective(d Directive)
SendDirective is the public facing API to set state variables in the test
func (*StressTest) SendPackage ¶
func (st *StressTest) SendPackage(p Package)
SendPackage is the public facing API for to send Queries and Points
func (*StressTest) SetCommune ¶
func (st *StressTest) SetCommune(name string) chan<- string
SetCommune creates a new commune on the StressTest