load

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChannelCapacityFlagVal = 0
)
View Source
const LoaderTestResultVersion = "0.1"

Variables

This section is empty.

Functions

func GetBufferedReader

func GetBufferedReader(fileName string) *bufio.Reader

GetBufferedReader returns the buffered Reader that should be used by the file loader if no file name is specified a buffer for STDIN is returned

Types

type BenchmarkRunner

type BenchmarkRunner interface {
	DatabaseName() string
	RunBenchmark(b targets.Benchmark)
}

func GetBenchmarkRunner

func GetBenchmarkRunner(c BenchmarkRunnerConfig) BenchmarkRunner

GetBenchmarkRunnerWithBatchSize returns the singleton CommonBenchmarkRunner for use in a benchmark program with specified batch size.

type BenchmarkRunnerConfig

type BenchmarkRunnerConfig struct {
	DBName          string        `yaml:"db-name" mapstructure:"db-name" json:"db-name"`
	BatchSize       uint          `yaml:"batch-size" mapstructure:"batch-size" json:"batch-size"`
	Workers         uint          `yaml:"workers" mapstructure:"workers" json:"workers"`
	Limit           uint64        `yaml:"limit" mapstructure:"limit" json:"limit"`
	DoLoad          bool          `yaml:"do-load" mapstructure:"do-load" json:"do-load"`
	DoCreateDB      bool          `yaml:"do-create-db" mapstructure:"do-create-db" json:"do-create-db"`
	DoAbortOnExist  bool          `yaml:"do-abort-on-exist" mapstructure:"do-abort-on-exist" json:"do-abort-on-exist"`
	ReportingPeriod time.Duration `yaml:"reporting-period" mapstructure:"reporting-period" json:"reporting-period"`
	HashWorkers     bool          `yaml:"hash-workers" mapstructure:"hash-workers" json:"hash-workers"`
	NoFlowControl   bool          `yaml:"no-flow-control" mapstructure:"no-flow-control" json:"no-flow-control"`
	ChannelCapacity uint          `yaml:"channel-capacity" mapstructure:"channel-capacity" json:"channel-capacity"`
	InsertIntervals string        `yaml:"insert-intervals" mapstructure:"insert-intervals" json:"insert-intervals"`
	ResultsFile     string        `yaml:"results-file" mapstructure:"results-file" json:"results-file"`
	// deprecated, should not be used in other places other than tsbs_load_xx commands
	FileName string `yaml:"file" mapstructure:"file" json:"file"`
	Seed     int64  `yaml:"seed" mapstructure:"seed" json:"seed"`
}

BenchmarkRunnerConfig contains all the configuration information required for running BenchmarkRunner.

func (BenchmarkRunnerConfig) AddToFlagSet

func (c BenchmarkRunnerConfig) AddToFlagSet(fs *pflag.FlagSet)

AddToFlagSet adds command line flags needed by the BenchmarkRunnerConfig to the flag set.

type CommonBenchmarkRunner

type CommonBenchmarkRunner struct {
	BenchmarkRunnerConfig
	// contains filtered or unexported fields
}

CommonBenchmarkRunner is responsible for initializing and storing common flags across all database systems and ultimately running a supplied Benchmark

func (*CommonBenchmarkRunner) DatabaseName

func (l *CommonBenchmarkRunner) DatabaseName() string

DatabaseName returns the value of the --db-name flag (name of the database to store data)

func (*CommonBenchmarkRunner) RunBenchmark

func (l *CommonBenchmarkRunner) RunBenchmark(b targets.Benchmark)

RunBenchmark takes in a Benchmark b and uses it to run the load benchmark

type LoaderTestResult

type LoaderTestResult struct {
	// Format Configs
	ResultFormatVersion string `json:"ResultFormatVersion"`

	// RunnerConfig Configs
	RunnerConfig BenchmarkRunnerConfig `json:"RunnerConfig"`

	// Run info
	StartTime      int64 `json:"StartTime`
	EndTime        int64 `json:"EndTime"`
	DurationMillis int64 `json:"DurationMillis"`

	// Totals
	Totals map[string]interface{} `json:"Totals"`
}

LoaderTestResult aggregates the results of an insert or load benchmark in a common format across targets

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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