Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadUp ¶
func LoadUp( ctx context.Context, qe QueryExecutor, work []*WorkLoad, statsRec StatsRecorder, d time.Duration, ) (err error)
LoadUp generates load as specified in given workload
Types ¶
type CassandraQueryExecutor ¶
type CassandraQueryExecutor struct {
// contains filtered or unexported fields
}
CassandraQueryExecutor used to execute CQL
func (*CassandraQueryExecutor) Close ¶
func (c *CassandraQueryExecutor) Close()
Close cassandra session
func (*CassandraQueryExecutor) Exec ¶
func (c *CassandraQueryExecutor) Exec(t *txnContext, qIdx int) (*QueryResponse, error)
Exec executes a query and returns the rows affected
func (*CassandraQueryExecutor) Query ¶
func (c *CassandraQueryExecutor) Query(t *txnContext, qIdx int) (*QueryResponse, error)
Query stores the result of a query in txnContext
type CockroachQueryExecutor ¶
type CockroachQueryExecutor struct {
DB txExecutor
}
CockroachQueryExecutor Used to execute SQL on CockroachDB
func (*CockroachQueryExecutor) Close ¶
func (c *CockroachQueryExecutor) Close()
Close CockroachDB connection
func (*CockroachQueryExecutor) Exec ¶
func (c *CockroachQueryExecutor) Exec(t *txnContext, qIdx int) (*QueryResponse, error)
Exec executes a query and returns the rows affected
func (*CockroachQueryExecutor) Query ¶
func (c *CockroachQueryExecutor) Query(t *txnContext, qIdx int) (*QueryResponse, error)
Query stores the result of a query in txnContext
type QueryExecutor ¶
type QueryExecutor interface { // Exec executes a query and returns the rows affected // qIdx is the index of the query in txnContext to execute Exec(t *txnContext, qIdx int) (*QueryResponse, error) // Query stores the result of a query in txnContext // qIdx is the index of the query in txnContext to execute Query(t *txnContext, qIdx int) (*QueryResponse, error) // Close query executor Close() }
QueryExecutor interface for a Query Executor SQLoad runs load on any struct implementing this interface
func NewCassandraQueryExecutor ¶
func NewCassandraQueryExecutor( opts cqlutil.CassandraOptions, ) (QueryExecutor, error)
NewCassandraQueryExecutor creates a new CassandraQueryExecutor with given options
func NewCockroachQueryExecutor ¶
func NewCockroachQueryExecutor(url string) (QueryExecutor, error)
NewCockroachQueryExecutor creates a new CockroachQueryExecutor from the given URL
func NewCockroachTransactionExecutor ¶
func NewCockroachTransactionExecutor(tx *sql.Tx) QueryExecutor
NewCockroachTransactionExecutor creates a new CockroachQueryExecutor from sql.Tx
type QueryResponse ¶
type QueryResponse struct {
RowCount int64
}
QueryResponse for executing a query
type StatsCtx ¶
type StatsCtx interface { //ReportInt reports int as counter/guages ReportInt(name string, val int) //ReportStr reports errors ReportStr(name string, val string) //Stop stops stats-ctx Stop() }
StatsCtx abstracts ability to post performance mesurements by context
type StatsRecorder ¶
type StatsRecorder interface { //Initialize for an ID. It is not necessary to initialize an ID. //Initialize can be used to create new counters and flush them //to the appropriate endpoint. With this 0 counts can be flushed Initialize(id string) //Start a new stats-ctx Start(id string) StatsCtx //Flush stats so that they are persisted Flush() //Summary returns a summary of the metrics Summary() string }
StatsRecorder provides ability to report performance stats
in a context aware way
func NewCountingStatsRecorder ¶
func NewCountingStatsRecorder() StatsRecorder
NewCountingStatsRecorder creates counting-stats-recorder
func NewGraphiteStatsRecorder ¶
func NewGraphiteStatsRecorder( hostPort string, flushInterval time.Duration, senderID string, ) ( StatsRecorder, error, )
NewGraphiteStatsRecorder creates a recorder that pushes data to graphite
func NewNoOpStatsRecorder ¶
func NewNoOpStatsRecorder() StatsRecorder
NewNoOpStatsRecorder creates a recorder that discards data (used for warmup)
type WorkLoad ¶
type WorkLoad struct { Name string `json:"name"` Concurrency int `json:"concurrency"` Interval duration `json:"interval"` AsOf string `json:"as_of"` ForceIgnoreRollOver bool `json:"force_ignore_rollover"` LatencyThresh string `json:"latency_thresh"` // Used by rk_pytest RunWithoutTx bool `json:"run_without_tx"` Transaction []query Params params // contains filtered or unexported fields }
WorkLoad defines a sequence of queries, flow or a txn to be used for load gen
func ParseWorkLoad ¶
ParseWorkLoad parses, loads and validates the workload spec content The generator names used in the workload are defined in idToGen
func ParseWorkLoadWithLoadOpts ¶
func ParseWorkLoadWithLoadOpts( ctx context.Context, rawData []byte, gens generators, opts *sqloadOptions, ) ([]*WorkLoad, error)
ParseWorkLoadWithLoadOpts parses, loads and validates the workload spec content The generator names used in the workload are defined in idToGen loadOptions are used to configure the rand source