bench

package
v0.0.0-...-7a30d8d Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintTrace

func PrintTrace(w io.Writer, trace []TraceStep) (n int, err error)

func ReadReq

func ReadReq(ctx context.Context, args *issueArgs, rng *rand.Rand, wg *sync.WaitGroup, start time.Time)

func WriteReq

func WriteReq(ctx context.Context, args *issueArgs, rng *rand.Rand, wg *sync.WaitGroup, start time.Time)

Types

type Config

type Config struct {
	RecordCount int64 `json:"recordCount"`
	KeySize     int   `json:"keySize"`
	ValSize     int   `json:"valSize"`
	// contains filtered or unexported fields
}

type Loader

type Loader struct {
	Log             Logger
	DB              db.DB
	Config          Config
	Rand            *rand.Rand
	NumWorkers      int
	AllowedFailFrac float64

	LoadStart int64
	LoadCount int64
	// contains filtered or unexported fields
}

func (*Loader) Run

func (l *Loader) Run(ctx context.Context) error

type Logger

type Logger interface {
	Print(v ...interface{})
	Printf(format string, v ...interface{})
}

type Runner

type Runner struct {
	Log    Logger
	DB     db.DB
	Config Config
	Rand   *rand.Rand
	Trace  []TraceStep

	ReadRecorder  *recorders.MultiLatency
	ReadWriter    recorders.MultiLogWriter
	WriteRecorder *recorders.MultiLatency
	WriteWriter   recorders.MultiLogWriter
	// contains filtered or unexported fields
}

func (*Runner) Run

func (r *Runner) Run(parentCtx context.Context) error

type TraceStep

type TraceStep struct {
	Duration     time.Duration
	ReadKeyDist  keyDist
	WriteKeyDist keyDist
	ArrivalDist  arrivalDist
	RWRatio      float32
	AvgQPS       uint32
}

func ParseTrace

func ParseTrace(r io.Reader) ([]TraceStep, error)

func (*TraceStep) String

func (t *TraceStep) String() string

type WorkloadReqFunc

type WorkloadReqFunc func(ctx context.Context, args *issueArgs, rng *rand.Rand, wg *sync.WaitGroup, start time.Time)

A WorkloadReqFunc executes one request in a workload. If wg is not nil, Done() will be called once on wg once the function is complete.

Jump to

Keyboard shortcuts

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