Documentation ¶
Index ¶
- func NewOutputConfig() *outputConfig
- type AbstractField
- type AbstractFields
- type AbstractTag
- type AbstractTags
- type BasicClient
- type BasicPointGenerator
- type BasicProvisioner
- type BasicQuery
- type BasicQueryClient
- type BroadcastChannel
- type ConcurrencyLimiter
- type Config
- type Field
- type Fields
- type InfluxClient
- type InfluxClients
- type KeyValue
- type Pnt
- type Point
- type PointGenerator
- type PointGenerators
- type Provision
- type Provisioner
- type Querier
- type Query
- type QueryClient
- type QueryClients
- type QueryGenerator
- type QueryGenerators
- type QueryResponse
- type Read
- type ResponseTime
- type ResponseTimes
- type StdPoint
- type StressTest
- type Tag
- type Tags
- type Timer
- type Write
- type WriteResponse
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOutputConfig ¶
func NewOutputConfig() *outputConfig
Types ¶
type AbstractField ¶
AbstractField is a struct that abstractly defines a field
type AbstractFields ¶
type AbstractFields []AbstractField
AbstractFields is a slice of abstract fields
func (AbstractFields) Template ¶
func (f AbstractFields) Template() (string, []string)
Template returns a templated string of fields
type AbstractTag ¶
AbstractTag is a struct that abstractly defines a tag
type AbstractTags ¶
type AbstractTags []AbstractTag
AbstractTags is a slice of abstract tags
func (AbstractTags) Template ¶
func (t AbstractTags) Template() string
Template returns a templated string of tags
type BasicClient ¶
type BasicClient struct { Enabled bool `toml:"enabled"` Addresses []string `toml:"addresses"` Database string `toml:"database"` Precision string `toml:"precision"` BatchSize int `toml:"batch_size"` BatchInterval string `toml:"batch_interval"` Concurrency int `toml:"concurrency"` SSL bool `toml:"ssl"` Format string `toml:"format"` // contains filtered or unexported fields }
BasicClient implements the InfluxClient interface.
func (*BasicClient) BasicWriteHandler ¶
func (b *BasicClient) BasicWriteHandler(rs <-chan response, wt *Timer)
BasicWriteHandler handles write responses.
func (*BasicClient) Batch ¶
func (c *BasicClient) Batch(ps <-chan Point, r chan<- response) error
Batch groups together points
type BasicPointGenerator ¶
type BasicPointGenerator struct { PointCount int `toml:"point_count"` Tick string `toml:"tick"` Jitter bool `toml:"jitter"` Measurement string `toml:"measurement"` SeriesCount int `toml:"series_count"` Tags AbstractTags `toml:"tag"` Fields AbstractFields `toml:"field"` StartDate string `toml:"start_date"` Precision string `toml:"precision"` // contains filtered or unexported fields }
BasicPointGenerator implements the PointGenerator interface
func (*BasicPointGenerator) Generate ¶
func (b *BasicPointGenerator) Generate() (<-chan Point, error)
Generate returns a point channel. Implements the Generate method for the PointGenerator interface
func (*BasicPointGenerator) Template ¶
func (b *BasicPointGenerator) Template() func(i int, t time.Time) *Pnt
Template returns a function that returns a pointer to a Pnt.
func (*BasicPointGenerator) Time ¶
func (b *BasicPointGenerator) Time() time.Time
Time returns the timestamp for the latest points that are being generated. Implements the Time method for the PointGenerator interface.
type BasicProvisioner ¶
type BasicProvisioner struct { Enabled bool `toml:"enabled"` Address string `toml:"address"` Database string `toml:"database"` ResetDatabase bool `toml:"reset_database"` }
BasicProvisioner implements the Provisioner interface.
func (*BasicProvisioner) Provision ¶
func (b *BasicProvisioner) Provision() error
Provision runs the resetDB function.
type BasicQuery ¶
type BasicQuery struct { Template Query `toml:"template"` QueryCount int `toml:"query_count"` // contains filtered or unexported fields }
BasicQuery implements the QueryGenerator interface
func (*BasicQuery) QueryGenerate ¶
func (q *BasicQuery) QueryGenerate(now func() time.Time) (<-chan Query, error)
QueryGenerate returns a Query channel
func (*BasicQuery) SetTime ¶
func (q *BasicQuery) SetTime(t time.Time)
SetTime sets the internal state of time
type BasicQueryClient ¶
type BasicQueryClient struct { Enabled bool `toml:"enabled"` Addresses []string `toml:"addresses"` Database string `toml:"database"` QueryInterval string `toml:"query_interval"` Concurrency int `toml:"concurrency"` // contains filtered or unexported fields }
BasicQueryClient implements the QueryClient interface
func (*BasicQueryClient) BasicReadHandler ¶
func (b *BasicQueryClient) BasicReadHandler(r <-chan response, rt *Timer)
BasicReadHandler handles read responses.
func (*BasicQueryClient) Exec ¶
func (b *BasicQueryClient) Exec(qs <-chan Query, r chan<- response) error
Exec listens to the query channel an executes queries as they come in
func (*BasicQueryClient) Init ¶
func (b *BasicQueryClient) Init() error
Init initializes the InfluxDB client
func (*BasicQueryClient) Query ¶
func (b *BasicQueryClient) Query(cmd Query) (response, error)
Query runs the query
type BroadcastChannel ¶
type BroadcastChannel struct {
// contains filtered or unexported fields
}
func NewBroadcastChannel ¶
func NewBroadcastChannel() *BroadcastChannel
func (*BroadcastChannel) Broadcast ¶
func (b *BroadcastChannel) Broadcast(r response)
func (*BroadcastChannel) Close ¶
func (b *BroadcastChannel) Close()
func (*BroadcastChannel) Handle ¶
func (b *BroadcastChannel) Handle(rs <-chan response, t *Timer)
func (*BroadcastChannel) Register ¶
func (b *BroadcastChannel) Register(fn responseHandler)
type ConcurrencyLimiter ¶
type ConcurrencyLimiter struct {
// contains filtered or unexported fields
}
ConcurrencyLimiter is a go routine safe struct that can be used to ensure that no more than a specifid max number of goroutines are executing.
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.
type Config ¶
type Config struct { Provision Provision `toml:"provision"` Write Write `toml:"write"` Read Read `toml:"read"` }
Config is a struct for the Stress test configuration
func BasicStress ¶
BasicStress returns a config for a basic stress test.
func DecodeConfig ¶
DecodeConfig takes a file path for a toml config file and returns a pointer to a Config Struct.
func DecodeFile ¶
DecodeFile takes a file path for a toml config file and returns a pointer to a Config Struct.
type InfluxClient ¶
type InfluxClient interface { Batch(ps <-chan Point, r chan<- response) error // contains filtered or unexported methods }
InfluxClient is an interface for writing data to the database.
type InfluxClients ¶
type InfluxClients struct {
Basic BasicClient `toml:"basic"`
}
InfluxClients is a struct that contains the configuration parameters for all implemented InfluxClient's.
type Pnt ¶
type Pnt struct {
// contains filtered or unexported fields
}
Pnt is a struct that implements the Point interface.
func (Pnt) OpenTelnet ¶
OpenTelnet returns a byte array for a point in opentsdb-telnet format
type Point ¶
Point is an interface that is used to represent the abstract idea of a point in InfluxDB.
type PointGenerator ¶
PointGenerator is an interface for generating points.
type PointGenerators ¶
type PointGenerators struct {
Basic BasicPointGenerator `toml:"basic"`
}
PointGenerators is a struct that contains the configuration parameters for all implemented PointGenerator's.
type Provision ¶
type Provision struct {
Basic BasicProvisioner `toml:"basic"`
}
Provision is a struct that contains the configuration parameters for all implemented Provisioner's.
type Provisioner ¶
type Provisioner interface {
Provision() error
}
Provisioner is an interface that provisions an InfluxDB instance
type Querier ¶
type Querier struct { QueryGenerator QueryClient }
Querier queries the database.
func NewQuerier ¶
func NewQuerier(q QueryGenerator, c QueryClient) Querier
NewQuerier returns a Querier.
type QueryClient ¶
type QueryClient interface { Query(q Query) (response, error) Exec(qs <-chan Query, r chan<- response) error }
QueryClient is an interface that can write a query to an InfluxDB instance.
type QueryClients ¶
type QueryClients struct {
Basic BasicQueryClient `toml:"basic"`
}
QueryClients is a struct that contains the configuration parameters for all implemented QueryClient's.
type QueryGenerator ¶
type QueryGenerator interface { QueryGenerate(f func() time.Time) (<-chan Query, error) SetTime(t time.Time) }
QueryGenerator is an interface that is used to define queries that will be ran on the DB.
type QueryGenerators ¶
type QueryGenerators struct {
Basic BasicQuery `toml:"basic"`
}
QueryGenerators is a struct that contains the configuration parameters for all implemented QueryGenerator's.
type QueryResponse ¶
type QueryResponse struct { Body string // contains filtered or unexported fields }
QueryResponse is a response for a Querier
type Read ¶
type Read struct { QueryGenerators QueryGenerators `toml:"query_generator"` QueryClients QueryClients `toml:"query_client"` }
Read is a struct that contains the configuration parameters for the stress test Reader.
type ResponseTime ¶
ResponseTime is a struct that contains `Value` `Time` pairing.
func NewResponseTime ¶
func NewResponseTime(v int) ResponseTime
NewResponseTime returns a new response time with value `v` and time `time.Now()`.
type ResponseTimes ¶
type ResponseTimes []ResponseTime
ResponseTimes is a slice of response times
func (ResponseTimes) Len ¶
func (rs ResponseTimes) Len() int
Implements the `Len` method for the sort.Interface type
func (ResponseTimes) Less ¶
func (rs ResponseTimes) Less(i, j int) bool
Implements the `Less` method for the sort.Interface type
func (ResponseTimes) Swap ¶
func (rs ResponseTimes) Swap(i, j int)
Implements the `Swap` method for the sort.Interface type
type StdPoint ¶
StdPoint represents a point in InfluxDB
func (StdPoint) OpenTelnet ¶
OpenTelnet returns a byte array for a point in OpenTSDB-telnet format
type StressTest ¶
type StressTest struct { Provisioner Writer Querier }
StressTest is a struct that contains all of the logic required to execute a Stress Test
func NewStressTest ¶
func NewStressTest(p Provisioner, w Writer, r Querier) StressTest
NewStressTest returns an instance of a StressTest
func (*StressTest) Start ¶
func (s *StressTest) Start(wHandle responseHandler, rHandle responseHandler)
Start executes the Stress Test
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer is struct that can be used to track elaspsed time
func NewTimer ¶
func NewTimer() *Timer
NewTimer returns a pointer to a `Timer` struct where the timers `start` field has been set to `time.Now()`
func (*Timer) Elapsed ¶
Elapsed returns the total elapsed time between the `start` and `end` fields on a timer.
func (*Timer) StartTimer ¶
func (t *Timer) StartTimer()
StartTimer sets a timers `start` field to the current time
type Write ¶
type Write struct { PointGenerators PointGenerators `toml:"point_generator"` InfluxClients InfluxClients `toml:"influx_client"` }
Write is a struct that contains the configuration parameters for the stress test Writer.
type Writer ¶
type Writer struct { PointGenerator InfluxClient }
Writer is a PointGenerator and an InfluxClient.
func NewWriter ¶
func NewWriter(p PointGenerator, i InfluxClient) Writer
NewWriter returns a Writer.