driver

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: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentTest string
View Source
var HousekeepingSvc *s3.S3
View Source
var PromTestEnd = prom.NewGaugeVec(
	prom.GaugeOpts{
		Name:      "test_end",
		Namespace: "gosbench",
		Help:      "Determines the end time of a job for Grafana annotations",
	}, []string{"testName"})
View Source
var PromTestStart = prom.NewGaugeVec(
	prom.GaugeOpts{
		Name:      "test_start",
		Namespace: "gosbench",
		Help:      "Determines the start time of a job for Grafana annotations",
	}, []string{"testName"})
View Source
var RandomData []byte
View Source
var WorkCancel context.CancelFunc

WorkCancel is the function to stop the execution of jobs

View Source
var WorkContext context.Context

Functions

func CreateBucket

func CreateBucket(service *s3.S3, bucket string) error

func DeleteBucket

func DeleteBucket(service *s3.S3, bucket string) error

func DoWork

func DoWork(workChannel chan WorkItem, doneChannel chan bool)

DoWork processes the workitems in the workChannel until either the time runs out or a stopper is found

func GenerateRandomBytes

func GenerateRandomBytes(size uint64) []byte

func GetCurrentPromValues

func GetCurrentPromValues(testConfig *common.TestCaseConfiguration) common.BenchmarkResult

func GetExistingReadObjectList

func GetExistingReadObjectList(service *s3.S3, prefix string, bucket string) ([]*s3.Object, error)

func GetNextOperation

func GetNextOperation(Queue *Workqueue) string

GetNextOperation evaluates the operation values and returns which operation should happen next

func IncreaseOperationValue

func IncreaseOperationValue(operation string, value float64, Queue *Workqueue) error

IncreaseOperationValue increases the given operation's value by the set amount

func InitPrometheus

func InitPrometheus(prometheusPort int)

func InitS3

func InitS3(config common.S3Configuration)

InitS3 initialises the S3 session Also starts the Prometheus exporter on Port 8888

func ListObjects

func ListObjects(service *s3.S3, prefix string, bucket string) (*s3.ListObjectsOutput, error)

Types

type DeleteOperation

type DeleteOperation struct {
	TestName                 string
	Bucket                   string
	ObjectName               string
	ObjectSize               uint64
	WorksOnPreexistingObject bool
	MPUEnabled               bool
	PartSize                 uint64
	MPUConcurrency           int
}

DeleteOperation stands for a delete operation

func (DeleteOperation) Clean

func (op DeleteOperation) Clean() error

Clean removes the objects and buckets left from the previous DeleteOperation

func (DeleteOperation) Do

func (op DeleteOperation) Do() error

Do executes the actual work of the DeleteOperation

func (DeleteOperation) Prepare

func (op DeleteOperation) Prepare() error

Prepare prepares the execution of the DeleteOperation

type GBTransport

type GBTransport struct {
	Base http.RoundTripper
}

func (GBTransport) RoundTrip

func (gt GBTransport) RoundTrip(req *http.Request) (*http.Response, error)

type KV

type KV struct {
	Key   string
	Value float64
}

KV is a simple key-value struct

type ListOperation

type ListOperation struct {
	TestName       string
	Bucket         string
	ObjectName     string
	ObjectSize     uint64
	MPUEnabled     bool
	PartSize       uint64
	MPUConcurrency int
}

ListOperation stands for a list operation

func (ListOperation) Clean

func (op ListOperation) Clean() error

Clean removes the objects and buckets left from the previous ListOperation

func (ListOperation) Do

func (op ListOperation) Do() error

Do executes the actual work of the ListOperation

func (ListOperation) Prepare

func (op ListOperation) Prepare() error

Prepare prepares the execution of the ListOperation

type ReadOperation

type ReadOperation struct {
	TestName                 string
	Bucket                   string
	ObjectName               string
	ObjectSize               uint64
	WorksOnPreexistingObject bool
	MPUEnabled               bool
	PartSize                 uint64
	MPUConcurrency           int
}

ReadOperation stands for a read operation

func (ReadOperation) Clean

func (op ReadOperation) Clean() error

Clean removes the objects and buckets left from the previous ReadOperation

func (ReadOperation) Do

func (op ReadOperation) Do() error

Do executes the actual work of the ReadOperation

func (ReadOperation) Prepare

func (op ReadOperation) Prepare() error

Prepare prepares the execution of the ReadOperation

type Stopper

type Stopper struct{}

Stopper marks the end of a workqueue when using maxOps as testCase end criterium

func (Stopper) Clean

func (op Stopper) Clean() error

Clean does nothing here

func (Stopper) Do

func (op Stopper) Do() error

Do does nothing here

func (Stopper) Prepare

func (op Stopper) Prepare() error

Prepare does nothing here

type Tracker

type Tracker struct {
	Start    time.Time
	ReqWrote time.Time
	Method   string
}

func (*Tracker) GotFirstResponseByte

func (tr *Tracker) GotFirstResponseByte()

GotFirstResponseByte is called when the first byte of the response headers is available.

func (*Tracker) WroteRequest

func (tr *Tracker) WroteRequest(wroteRequest httptrace.WroteRequestInfo)

WroteRequest is called with the result of writing the request and any body. It may be called multiple times in the case of retried requests.

type WorkItem

type WorkItem interface {
	Prepare() error
	Do() error
	Clean() error
}

WorkItem is an interface for general work operations They can be read,write,list,delete or a stopper

type Workqueue

type Workqueue struct {
	OperationValues []KV
	Queue           *[]WorkItem
}

Workqueue contains the Queue and the valid operation's values to determine which operation should be done next in order to satisfy the set ratios.

type WriteOperation

type WriteOperation struct {
	TestName       string
	Bucket         string
	ObjectName     string
	ObjectSize     uint64
	MPUEnabled     bool
	PartSize       uint64
	MPUConcurrency int
}

WriteOperation stands for a write operation

func (WriteOperation) Clean

func (op WriteOperation) Clean() error

Clean removes the objects and buckets left from the previous WriteOperation

func (WriteOperation) Do

func (op WriteOperation) Do() error

Do executes the actual work of the WriteOperation

func (WriteOperation) Prepare

func (op WriteOperation) Prepare() error

Prepare prepares the execution of the WriteOperation

Jump to

Keyboard shortcuts

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