load

package
v0.0.0-...-e01a1e4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultChannelCapacityFlagVal = 0
)

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

func GetBufferedWriter

func GetBufferedWriter(fileName string) *bufio.Writer

GetBufferedWriter returns the buffered Writer that should be used by the file writer 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"`
	BatchSize       uint          `yaml:"batch-size" mapstructure:"batch-size"`
	Workers         uint          `yaml:"workers" mapstructure:"workers"`
	Limit           uint64        `yaml:"limit" mapstructure:"limit"`
	DoLoad          bool          `yaml:"do-load" mapstructure:"do-load"`
	DoCreateDB      bool          `yaml:"do-create-db" mapstructure:"do-create-db"`
	DoAbortOnExist  bool          `yaml:"do-abort-on-exist" mapstructure:"do-abort-on-exist"`
	ReportingPeriod time.Duration `yaml:"reporting-period" mapstructure:"reporting-period"`
	HashWorkers     bool          `yaml:"hash-workers" mapstructure:"hash-workers"`
	NoFlowControl   bool          `yaml:"no-flow-control" mapstructure:"no-flow-control"`
	ChannelCapacity uint          `yaml:"channel-capacity" mapstructure:"channel-capacity"`
	InsertIntervals string        `yaml:"insert-intervals" mapstructure:"insert-intervals"`
	LatenciesFile   string        `yaml:"latencies-file" mapstructure:"latencies-file"`
	// deprecated, should not be used in other places other than tsbs_load_xx commands
	FileName string `yaml:"file" mapstructure:"file"`
	Seed     int64  `yaml:"seed" mapstructure:"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 Stat

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

Stat represents one statistical measurement, typically used to store the latency of a query (or part of query).

func GetPartialStat

func GetPartialStat() *Stat

GetPartialStat returns a partial Stat for use from a pool

func GetStat

func GetStat() *Stat

GetStat returns a Stat for use from a pool

func (*Stat) Init

func (s *Stat) Init(label []byte, id uint64, value float64) *Stat

Init safely initializes a Stat while minimizing heap allocations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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