tempfiles

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

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

func NewWorkload

func NewWorkload(config Config, logger log.Logger) (noisia.Workload, error)

NewWorkload creates a new workload with specified config.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL