common

package
v0.0.0-...-76eb69a Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BYTE = 1 << (10 * iota)
	KILOBYTE
	MEGABYTE
	GIGABYTE
	TERABYTE
)

This uses the Base 2 calculation where 1 kB = 1024 Byte

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig(config Testconf)

CheckConfig checks the global config

func EvaluateDistribution

func EvaluateDistribution(min uint64, max uint64, lastNumber *uint64, increment uint64, distribution string) uint64

EvaluateDistribution looks at the given distribution and returns a meaningful next number

Types

type BenchmarkResult

type BenchmarkResult struct {
	Host             string
	TestName         string
	OperationName    string
	ObjectSize       float64
	Operations       float64
	FailedOperations float64
	OpsPerSecond     float64
	Workers          int
	Bytes            float64
	// Bandwidth is the amount of Bytes per second of runtime
	Bandwidth      float64
	RTLatencyAvg   float64
	TTFBLatencyAvg float64
	SuccessRatio   float64
	StartTime      time.Time
	StopTime       time.Time
	Duration       time.Duration
	Options        string
}

BenchResult is the struct that will contain the benchmark results from a driver after it has finished its benchmark

type DriverConf

type DriverConf struct {
	S3Config *S3Configuration
	Test     *TestCaseConfiguration
	DriverID string
}

DriverConf is the configuration that is sent to each driver It includes a subset of information from the Testconf

type DriverMessage

type DriverMessage struct {
	Message     string
	Config      *DriverConf
	BenchResult BenchmarkResult
}

DriverMessage is the struct that is exchanged in the communication between server and driver. It usually only contains a message, but during the init phase, also contains the config for the driver

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

type GrafanaConfiguration

type GrafanaConfiguration struct {
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Endpoint string `yaml:"endpoint" json:"endpoint"`
}

GrafanaConfiguration contains all information necessary to add annotations via the Grafana HTTP API

type S3Configuration

type S3Configuration struct {
	AccessKey     string        `yaml:"access_key" json:"access_key"`
	SecretKey     string        `yaml:"secret_key" json:"secret_key"`
	Region        string        `yaml:"region" json:"region"`
	Endpoint      string        `yaml:"endpoint" json:"endpoint"`
	Timeout       time.Duration `yaml:"timeout" json:"timeout"`
	SkipSSLVerify bool          `yaml:"skipSSLverify" json:"skipSSLverify"`
	ProxyHost     string        `yaml:"proxyHost" json:"proxyHost"`
}

S3Configuration contains all information to connect to a certain S3 endpoint

type TestCaseConfiguration

type TestCaseConfiguration struct {
	Objects struct {
		SizeMin            uint64 `yaml:"size_min" json:"size_min"`
		SizeMax            uint64 `yaml:"size_max" json:"size_max"`
		SizeLast           uint64
		SizeDistribution   string `yaml:"size_distribution" json:"size_distribution"`
		NumberMin          uint64 `yaml:"number_min" json:"number_min"`
		NumberMax          uint64 `yaml:"number_max" json:"number_max"`
		NumberLast         uint64
		NumberDistribution string `yaml:"number_distribution" json:"number_distribution"`
		Unit               string `yaml:"unit" json:"unit"`
	} `yaml:"objects" json:"objects"`
	Buckets struct {
		NumberMin          uint64 `yaml:"number_min" json:"number_min"`
		NumberMax          uint64 `yaml:"number_max" json:"number_max"`
		NumberLast         uint64
		NumberDistribution string `yaml:"number_distribution" json:"number_distribution"`
	} `yaml:"buckets" json:"buckets"`
	Multipart struct {
		WriteMPUEnabled  bool   `yaml:"write_mpu_enabled" json:"write_mpu_enabled"`
		WritePartSize    uint64 `yaml:"write_part_size" json:"write_part_size"`
		WriteConcurrency int    `yaml:"write_concurrency" json:"write_concurrency"`
		WriteUnit        string `yaml:"write_unit" json:"write_unit"`
		ReadMPUEnabled   bool   `yaml:"read_mpu_enabled" json:"read_mpu_enabled"`
		ReadPartSize     uint64 `yaml:"read_part_size" json:"read_part_size"`
		ReadConcurrency  int    `yaml:"read_concurrency" json:"read_concurrency"`
		ReadUnit         string `yaml:"read_unit" json:"read_unit"`
	} `yaml:"multipart" json:"multipart"`
	Name                 string   `yaml:"name" json:"name"`
	BucketPrefix         string   `yaml:"bucket_prefix" json:"bucket_prefix"`
	ObjectPrefix         string   `yaml:"object_prefix" json:"object_prefix"`
	Runtime              Duration `yaml:"stop_with_runtime" json:"stop_with_runtime"`
	OpsDeadline          uint64   `yaml:"stop_with_ops" json:"stop_with_ops"`
	Drivers              int      `yaml:"drivers" json:"drivers"`
	DriversShareBuckets  bool     `yaml:"drivers_share_buckets" json:"drivers_share_buckets"`
	Workers              int      `yaml:"workers" json:"workers"`
	CleanAfter           bool     `yaml:"clean_after" json:"clean_after"`
	ReadWeight           int      `yaml:"read_weight" json:"read_weight"`
	ExistingReadWeight   int      `yaml:"existing_read_weight" json:"existing_read_weight"`
	WriteWeight          int      `yaml:"write_weight" json:"write_weight"`
	ListWeight           int      `yaml:"list_weight" json:"list_weight"`
	DeleteWeight         int      `yaml:"delete_weight" json:"delete_weight"`
	ExistingDeleteWeight int      `yaml:"existing_delete_weight" json:"existing_delete_weight"`
}

TestCaseConfiguration is the configuration of a performance test

type Testconf

type Testconf struct {
	S3Config      []*S3Configuration       `yaml:"s3_config" json:"s3_config"`
	GrafanaConfig *GrafanaConfiguration    `yaml:"grafana_config" json:"grafana_config"`
	Tests         []*TestCaseConfiguration `yaml:"tests" json:"tests"`
}

Testconf contains all the information necessary to set up a distributed test

type Workloadconf

type Workloadconf struct {
	GrafanaConfig *GrafanaConfiguration    `yaml:"grafana_config" json:"grafana_config"`
	Tests         []*TestCaseConfiguration `yaml:"tests" json:"tests"`
}

Workloadconf the Grafana and test configuration

Jump to

Keyboard shortcuts

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