Documentation
¶
Overview ¶
Package tempfiles defines implementation of workload which executes queries which create on-disk temporary files due to lack of work_mem.
Before the starting workload, necessary number of workers is started. Each worker connects to the database, creates connection pool and starts working loop. In the loop, worker executes queries in a dedicated goroutine (to avoid awaiting when query is finished). Before start query, reduce work_mem to guarantee creation of temp file. 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 temp files.
Jobs uint16
// Rate defines rate interval for queries executing.
Rate float64
}
Config defines configuration settings for temp files workload.