Documentation
¶
Overview ¶
Package rollbacks defines implementation of workload which issues definitely invalid queries which are doomed to fail and as a result pg_stat_database.xact_rollback counter is incremented.
For creating the workload, start required number of workers (number of goroutines depends on Config.Jobs). Each worker creates a temporary table. The table is used in queries to bypass parser errors related to querying non-existent table. Next, rollbacks loop is started. In the loop, a random query is selected and issued. The query obviously fails. Next query is executed accordingly to rate specified in Config.Rate. Workload duration is controlled by context created outside and passed to Run method. Context is passed to each worker and used in the worker's loop. When context expires loop is stopped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Conninfo defines connection string used for connecting to Postgres.
Conninfo string
// Jobs defines how many workers should be created for producing rollbacks.
Jobs uint16
// Rate defines rollbacks rate produced per second (per single worker).
Rate float64
}
Config defines configuration settings for rollbacks workload.