Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDBRunner ¶
NewDBRunner creates a new TimescaleDB query.Runner
Types ¶
type Benchmarker ¶
type Benchmarker struct { benchmark.Benchmarker // contains filtered or unexported fields }
Benchmarker benchmarks TimescaleDB queries.
func NewBenchmarker ¶
func NewBenchmarker(ctx context.Context, c *BenchmarkerConfig, input chan query.Query, output chan query.Result) (*Benchmarker, error)
NewBenchmarker creates a new Benchmarker.
func (*Benchmarker) Start ¶
func (b *Benchmarker) Start(ctx context.Context) error
Start starts the Benchmarker. Implements the run.Startable interface.
func (*Benchmarker) Stop ¶
func (b *Benchmarker) Stop(ctx context.Context) (query.StatsCollector, error)
type BenchmarkerConfig ¶
type BenchmarkerConfig struct { // Parsed according to https://github.com/jackc/pgx/blob/master/pgxpool/pool.go#L281-L297 respecting https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING DBConnectionURI string // Num of workers executing queries concurrently NumWorkers uint // QueryTimeout is the desired max query time. By default, no timeout is applied. QueryTimeout time.Duration // Debug enables/disables debug mode. Used for printing debug log lines. Debug bool // OutputFormat is the printing format. [human,csv,markdown], defaults to human. OutputFormat OutputFormat }
BenchmarkerConfig holds the configuration for the Benchmarker.
func (BenchmarkerConfig) Validate ¶
func (c BenchmarkerConfig) Validate() error
Validate validates the config.
type DB ¶
type DB interface {
Query(ctx context.Context, sql string, optionsAndArgs ...interface{}) (pgx.Rows, error)
}
DB represents a TimescaleDB database. It is based on pgx.Conn and pgxpool.Pool, which is a driver for PostgreSQL.
type OutputFormat ¶
type OutputFormat = string
const ( FormatHumanReadable OutputFormat = "human" FormatCSV OutputFormat = "csv" FormatTSV OutputFormat = "tsv" FormatMarkdown OutputFormat = "md" FormatHTML OutputFormat = "html" )
Click to show internal directories.
Click to hide internal directories.