workload

package
v4.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats

type Stats struct {
	sync.RWMutex

	BytesLoaded          uint64 `json:"bytes_loaded" doc:"Bytes loaded from disk"`
	BytesDecompressed    uint64 `json:"bytes_decompressed" doc:"Effective block size after decompression"`
	BlocksProcessed      uint64 `json:"blocks_processed" doc:"Number of blocks loaded from disk"`
	BlocksCorrupted      uint64 `json:"blocks_corrupted" doc:"Blocks which could not be loaded or processed"`
	DirectoriesProcessed uint64 `json:"directories_processed" doc:"Number of directories processed"`
	Workloads            uint64 `json:"workloads" doc:"Total number of workloads to be processed"`
}

Stats tracks interactions with the underlying DB data

func (*Stats) Add

func (s *Stats) Add(stats *Stats)

Add adds the values of stats to s

func (*Stats) LogValue

func (s *Stats) LogValue() (v slog.Value)

LogValue implements the slog.LogValuer interface

type StatsFunc

type StatsFunc func(stats *Stats)

StatsFunc is a function which can be used to communicate running workload statistics

type StatsFuncs

type StatsFuncs []StatsFunc

StatsCallbaacks is a list of StatsFuncs

func (StatsFuncs) Append

func (sfc StatsFuncs) Append(fn StatsFunc) StatsFuncs

Append appends a stats func to the existing stats funcs

func (StatsFuncs) Execute

func (scf StatsFuncs) Execute(stats *Stats)

Execute runs all callbacks

type Workload

type Workload struct {
	// contains filtered or unexported fields
}

Workload stores all relevant parameters to load a block and execute a query on it

func New

func New(workDirs []*gpfile.GPDir) *Workload

New creates a new workload

func (*Workload) AddStats

func (w *Workload) AddStats(s *Stats)

AddStats adds processing statistics to the stats of the workload

func (*Workload) AppendStatsFunc

func (w *Workload) AppendStatsFunc(fn StatsFunc) StatsFuncs

AppendStatsFunc appends the stats function to the existing stats func of the workload

func (*Workload) Stats

func (w *Workload) Stats() *Stats

Stats returns the stats tracked by the workload

func (*Workload) WorkDirs

func (w *Workload) WorkDirs() []*gpfile.GPDir

WorkDirs returns the directories the workload is working on

Jump to

Keyboard shortcuts

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