Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CassandraPool = sync.Pool{ New: func() interface{} { return &Cassandra{ HumanLabel: []byte{}, HumanDescription: []byte{}, MeasurementName: []byte{}, FieldName: []byte{}, AggregationType: []byte{}, ForEveryN: []byte{}, WhereClause: []byte{}, OrderBy: []byte{}, TagSets: [][]string{}, } }, }
CassandraPool is a sync.Pool of Cassandra Query types
var HTTPPool = sync.Pool{ New: func() interface{} { return &HTTP{ HumanLabel: []byte{}, HumanDescription: []byte{}, Method: []byte{}, Path: []byte{}, Body: []byte{}, StartTimestamp: 0, EndTimestamp: 0, } }, }
HTTPPool is a sync.Pool of HTTP Query types
var MongoPool = sync.Pool{ New: func() interface{} { return &Mongo{ HumanLabel: []byte{}, HumanDescription: []byte{}, CollectionName: []byte{}, BsonDoc: []bson.M{}, } }, }
MongoPool is a sync.Pool of Mongo Query types
var TimescaleDBPool = sync.Pool{ New: func() interface{} { return &TimescaleDB{ HumanLabel: make([]byte, 0, 1024), HumanDescription: make([]byte, 0, 1024), Hypertable: make([]byte, 0, 1024), SqlQuery: make([]byte, 0, 1024), } }, }
TimescaleDBPool is a sync.Pool of TimescaleDB Query types
Functions ¶
This section is empty.
Types ¶
type BenchmarkRunner ¶
type BenchmarkRunner struct {
// contains filtered or unexported fields
}
BenchmarkRunner contains the common components for running a query benchmarking program against a database.
func NewBenchmarkRunner ¶
func NewBenchmarkRunner() *BenchmarkRunner
NewBenchmarkRunner creates a new instance of BenchmarkRunner which is common functionality to be used by query benchmarker programs
func (*BenchmarkRunner) DatabaseName ¶
func (b *BenchmarkRunner) DatabaseName() string
DatabaseName returns the name of the database to run queries against
func (*BenchmarkRunner) DebugLevel ¶
func (b *BenchmarkRunner) DebugLevel() int
DebugLevel returns the level of debug messages for this benchmark
func (*BenchmarkRunner) DoPrintResponses ¶
func (b *BenchmarkRunner) DoPrintResponses() bool
DoPrintResponses indicates whether responses for queries should be printed
func (*BenchmarkRunner) ResetLimit ¶
func (b *BenchmarkRunner) ResetLimit(limit uint64)
ResetLimit changes the number of queries to run, with 0 being all of them
func (*BenchmarkRunner) Run ¶
func (b *BenchmarkRunner) Run(queryPool *sync.Pool, createFn ProcessorCreate)
Run does the bulk of the benchmark execution. It launches a gorountine to track stats, creates workers to process queries, read in the input, execute the queries, and then does cleanup.
type Cassandra ¶
type Cassandra struct { HumanLabel []byte HumanDescription []byte MeasurementName []byte // e.g. "cpu" FieldName []byte // e.g. "usage_user" AggregationType []byte // e.g. "avg" or "sum". used literally in the cassandra query. TimeStart time.Time TimeEnd time.Time GroupByDuration time.Duration ForEveryN []byte // e.g. "hostname,1" WhereClause []byte // e.g. "usage_user,>,90.0" OrderBy []byte // e.g. "timestamp_ns DESC" Limit int TagSets [][]string // semantically, each subgroup is OR'ed and they are all AND'ed together // contains filtered or unexported fields }
Cassandra encodes a Cassandra request. This will be serialized for use by the tsbs_run_queries_cassandra program.
func NewCassandra ¶
func NewCassandra() *Cassandra
NewCassandra returns a new Cassandra Query instance
func (*Cassandra) HumanDescriptionName ¶
HumanDescriptionName returns the human readable description of this Query
func (*Cassandra) HumanLabelName ¶
HumanLabelName returns the human readable name of this Query
type HTTP ¶
type HTTP struct { HumanLabel []byte HumanDescription []byte Method []byte Path []byte Body []byte StartTimestamp int64 EndTimestamp int64 // contains filtered or unexported fields }
HTTP encodes an HTTP request. This will typically by serialized for use by the appropriate tsbs_run_queries program.
func (*HTTP) HumanDescriptionName ¶
HumanDescriptionName returns the human readable description of this Query
func (*HTTP) HumanLabelName ¶
HumanLabelName returns the human readable name of this Query
type Mongo ¶
type Mongo struct { HumanLabel []byte HumanDescription []byte CollectionName []byte BsonDoc []bson.M ID uint64 }
Mongo encodes a Mongo request. This will be serialized for use by the tsbs_run_queries_mongo program.
func (*Mongo) HumanDescriptionName ¶
HumanDescriptionName returns the human readable description of this Query
func (*Mongo) HumanLabelName ¶
HumanLabelName returns the human readable name of this Query
type Processor ¶
type Processor interface { // Init initializes at global state for the Processor, possibly based on its worker number / ID Init(workerNum int) // ProcessQuery handles a given query and reports its stats ProcessQuery(q Query, isWarm bool) ([]*Stat, error) }
Processor is an interface that handles the setup of a query processing worker and executes queries one at a time
type ProcessorCreate ¶
type ProcessorCreate func() Processor
ProcessorCreate is a function that creates a new Procesor (called in Run)
type Query ¶
type Query interface { Release() HumanLabelName() []byte HumanDescriptionName() []byte GetID() uint64 SetID(uint64) fmt.Stringer }
Query is an interface used for encoding a benchmark query for different databases
type Stat ¶
type Stat struct {
// contains filtered or unexported fields
}
Stat represents one statistical measurement, typically used to store the latency of a query (or part of query).
func GetPartialStat ¶
func GetPartialStat() *Stat
GetPartialStat returns a partial Stat for use from a pool
type TimescaleDB ¶
type TimescaleDB struct { HumanLabel []byte HumanDescription []byte Hypertable []byte // e.g. "cpu" SqlQuery []byte // contains filtered or unexported fields }
TimescaleDB encodes a TimescaleDB request. This will be serialized for use by the tsbs_run_queries_timescaledb program.
func NewTimescaleDB ¶
func NewTimescaleDB() *TimescaleDB
NewTimescaleDB returns a new TimescaleDB Query instance
func (*TimescaleDB) HumanDescriptionName ¶
func (q *TimescaleDB) HumanDescriptionName() []byte
HumanDescriptionName returns the human readable description of this Query
func (*TimescaleDB) HumanLabelName ¶
func (q *TimescaleDB) HumanLabelName() []byte
HumanLabelName returns the human readable name of this Query
func (*TimescaleDB) Release ¶
func (q *TimescaleDB) Release()
Release resets and returns this Query to its pool
func (*TimescaleDB) String ¶
func (q *TimescaleDB) String() string
String produces a debug-ready description of a Query.