Documentation
¶
Index ¶
- Constants
- type BenchmarkConfig
- type Config
- type ConfigurablePlugin
- type Engine
- type ExecBenchFunc
- type ExecBenchOption
- type ExecBenchStat
- func (ebs *ExecBenchStat) AddSubStat(_ Stat)
- func (ebs *ExecBenchStat) GetCurrentProgress(_ ...interface{}) map[string]interface{}
- func (ebs *ExecBenchStat) GetFormattedSummary() string
- func (ebs *ExecBenchStat) GetName() string
- func (ebs *ExecBenchStat) GetProgress() string
- func (ebs *ExecBenchStat) GetSubStats() []Stat
- func (ebs *ExecBenchStat) GetSummary() string
- type ExecDDLFunc
- type ExecSetGUCsFunc
- type GeneratorConfig
- type GeneratorPrediction
- type GetTableSizeFunc
- type GlobalConfig
- type IBenchmark
- type IEngine
- type IGenerator
- type IWriter
- type NewBenchmarkFunc
- type NewGeneratorFunc
- type NewWriterFunc
- type NilCheck
- type Query
- type ReportFormat
- type Stat
- type VolumeDesc
- type WriteFunc
- type WriterConfig
Constants ¶
View Source
const ( NoticeColor = "\033[1;36m%s\033[0m" WarningColor = "\033[1;33m%s\033[0m" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BenchmarkConfig ¶
type BenchmarkConfig struct {
Plugin string `mapstructure:"benchmark"`
// Plugin specific config
PluginConfig interface{}
}
type Config ¶
type Config struct {
GlobalCfg GlobalConfig `mapstructure:"global"`
DB util.DBConnParams `mapstructure:"database"`
GeneratorCfg GeneratorConfig `mapstructure:"generator"`
WriterCfg WriterConfig `mapstructure:"writer"`
BenchmarkCfg BenchmarkConfig `mapstructure:"benchmark"`
// print config usage
Usage func()
NewGeneratorFunc NewGeneratorFunc
NewWriterFunc NewWriterFunc
NewBenchmarkFunc NewBenchmarkFunc
}
func (*Config) GlobalFlagSet ¶
type ConfigurablePlugin ¶
type ConfigurablePlugin interface {
// CreatePluginConfig returns a plugin specific config struct, can have any k=>v pairs
// It is plugin author's responsibility to tag "`mapstructure:"<key-name>"`" on struct members
// to make it able to export/import with config file
CreatePluginConfig() interface{}
// GetDefaultFlags returns a flagSet struct which have all flags with specified name, value, and usage string.
// Those key names should be consistent with tags "`mapstructure:"<key-name>"`" on the config struct
// The second return value is the plugin config struct created inside this function
GetDefaultFlags() (*pflag.FlagSet, interface{})
}
type Engine ¶
type Engine struct {
IGenerator IGenerator
IWriter IWriter
IBenchmark IBenchmark
Metadata *metadata.Metadata
VolumeDesc VolumeDesc
Config *Config
// contains filtered or unexported fields
}
func NewEngineFromConfig ¶
func (*Engine) GetFormattedSummary ¶
func (e *Engine) GetFormattedSummary()
func (*Engine) PrintProgress ¶
func (e *Engine) PrintProgress()
type ExecBenchOption ¶
type ExecBenchStat ¶
type ExecBenchStat struct {
TPS int `json:"tps"`
AvgLatency time.Duration `json:"avg-latency"`
MaxLatency time.Duration `json:"max-latency"`
P75Latency time.Duration `json:"p75-latency"`
P50Latency time.Duration `json:"p50-latency"`
P25Latency time.Duration `json:"p25-latency"`
TimeElapsed int64 `json:"overall-duration"`
// contains filtered or unexported fields
}
func NewExecBenchStat ¶
func NewExecBenchStat(opt ExecBenchOption, query Query) *ExecBenchStat
func (*ExecBenchStat) AddSubStat ¶
func (ebs *ExecBenchStat) AddSubStat(_ Stat)
func (*ExecBenchStat) GetCurrentProgress ¶
func (ebs *ExecBenchStat) GetCurrentProgress(_ ...interface{}) map[string]interface{}
func (*ExecBenchStat) GetFormattedSummary ¶
func (ebs *ExecBenchStat) GetFormattedSummary() string
GetFormattedSummary is aimed at outputing statistics in certain format. No data in will be rounded.
func (*ExecBenchStat) GetName ¶
func (ebs *ExecBenchStat) GetName() string
func (*ExecBenchStat) GetProgress ¶
func (ebs *ExecBenchStat) GetProgress() string
func (*ExecBenchStat) GetSubStats ¶
func (ebs *ExecBenchStat) GetSubStats() []Stat
func (*ExecBenchStat) GetSummary ¶
func (ebs *ExecBenchStat) GetSummary() string
GetSummary is aimed at presenting statistics to the user in the form of a table empowered by go-pretty. Any data in float will be rounded to 2 decimal places.
type ExecDDLFunc ¶
type ExecDDLFunc func() error
type ExecSetGUCsFunc ¶
type ExecSetGUCsFunc func() error
type GeneratorConfig ¶
type GeneratorConfig struct {
Plugin string `mapstructure:"generator"`
// Plugin specific config
PluginConfig interface{}
// derived from elsewhere
GlobalConfig *GlobalConfig
}
type GeneratorPrediction ¶
type GeneratorPrediction struct {
Count, Size int64
}
type GetTableSizeFunc ¶
type GlobalConfig ¶
type GlobalConfig struct {
SchemaName string `mapstructure:"schema-name"`
TableName string `mapstructure:"table-name"`
TagNum int64 `mapstructure:"tag-num"`
TimestampStart string `mapstructure:"ts-start"`
TimestampEnd string `mapstructure:"ts-end"`
PartitionIntervalInHour int64 `mapstructure:"partition-inteval-in-hour"`
IsRealtimeMode bool `mapstructure:"realtime"`
MetricsType metadata.MetricsType `mapstructure:"metrics-type"`
TotalMetricsCount int64 `mapstructure:"total-metrics-count"`
TimestampStepInSecond uint64 `mapstructure:"ts-step-in-second"`
Dump bool `mapstructure:"dump"`
MetricsDescriptions string `mapstructure:"metrics-descriptions"`
Workspace string `mapstructure:"workspace"`
DDLFilePath string `mapstructure:"ddl-file-path"`
SimultaneousLoadAndQuery bool `mapstructure:"simultaneous-loading-and-query"`
PreBenchmarkQuery string `mapstructure:"pre-benchmark-query"`
SkipSetGUCs bool `mapstructure:"skip-set-gucs"`
StorageType string `mapstructure:"storage-type"`
Degrade bool `mapstructure:"degrade"`
// Enhanced signal generation
SignalFile string `mapstructure:"signal-file"`
SignalPreset string `mapstructure:"signal-preset"`
MaxSimpleColumnNum int `mapstructure:"max-simple-column-num"`
JSONBSplitMode string `mapstructure:"jsonb-split-mode"`
JSONBMaxKeysPerColumn int64 `mapstructure:"jsonb-max-keys-per-column"`
// Bench-gen-only mode
BenchGenOnly bool `mapstructure:"bench-gen-only"`
BenchGenDurationSec int `mapstructure:"bench-gen-duration"`
// misc
Command string
CfgFile string
HelpWanted bool `mapstructure:"help"`
VersionWanted bool `mapstructure:"version"`
LogLevel string `mapstructure:"log-level"`
Watch bool `mapstructure:"watch"`
CPUProfile bool
StartAt time.Time
EndAt time.Time
ReportPath string `mapstructure:"report-path"`
ReportFormat ReportFormat `mapstructure:"report-format"`
}
func (*GlobalConfig) DoAfterInit ¶
func (cfg *GlobalConfig) DoAfterInit() error
func (*GlobalConfig) NewMetadataConfig ¶
func (cfg *GlobalConfig) NewMetadataConfig() *metadata.Config
type IBenchmark ¶
type IBenchmark interface {
NilCheck
ConfigurablePlugin
Run(<-chan error, Config, *metadata.Metadata, ExecBenchFunc) error
Close() error
GetStat() Stat
}
type IGenerator ¶
type IGenerator interface {
NilCheck
ConfigurablePlugin
GetPrediction(*metadata.Table) (GeneratorPrediction, error)
ModifyMetadataConfig(*metadata.Config)
Run(GlobalConfig, *metadata.Metadata, WriteFunc) error
Close() error
// BenchGenOnly runs a local-only data generation benchmark for the given duration.
// It generates and discards data, reporting throughput metrics.
BenchGenOnly(GlobalConfig, *metadata.Metadata, time.Duration) error
}
type NewBenchmarkFunc ¶
type NewBenchmarkFunc func(cfg BenchmarkConfig) IBenchmark
type NewGeneratorFunc ¶
type NewGeneratorFunc func(cfg GeneratorConfig) IGenerator
type NewWriterFunc ¶
type NewWriterFunc func(cfg WriterConfig) IWriter
type ReportFormat ¶
type ReportFormat = string
const ( ReportFormatCSV ReportFormat = "csv" ReportFormatJSON ReportFormat = "json" )
type VolumeDesc ¶
type VolumeDesc struct {
GeneratorPrediction GeneratorPrediction
GetTableSizeFunc GetTableSizeFunc
}
type WriterConfig ¶
type WriterConfig struct {
Plugin string `mapstructure:"writer"`
// Plugin specific config
PluginConfig interface{}
}
Click to show internal directories.
Click to hide internal directories.