workload

package
v0.0.0-...-e3473f1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxKeys being accessed by all threads
	MaxKeys = 5000

	// OpsPerThread being executed against the store
	OpsPerThread = 5000

	// DataSize is the number of bytes written to each key
	DataSize = 32
)

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) (b []byte, err error)

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func RandomKey

func RandomKey(keyspace, keylen int64) string

RandomKey returns a random key in the specified key range. For example if the keylen is 100, then range 0 is 0-99, range 1 is 100-199, etc. This function is used to generate random keys where keys in Range 0 are conflicting and keys in another range are not.

func RandomMutation

func RandomMutation(b []byte, m int) (err error)

RandomMutation modifies the byte array by replacing bytes with random bytes this method should be much quicker at modifying an existing random array than generating an entirely new random array of equal size.

Types

type Conflict

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

Conflict allocates a key range to each thread, along with a probability that the thread will access a key being accessed by a different thread. A 0% probability means that the clients will access a disjoint key set.

func NewConflict

func NewConflict(prob, readratio float32) *Conflict

NewConflict workload with the specified probability.

func (*Conflict) Run

func (c *Conflict) Run(store speedmap.Store, clients int) (*speedmap.Result, error)

Run the conflict workload for the specified number of clients.

func (*Conflict) String

func (c *Conflict) String() string

String returns a representation of the conflict workload

Jump to

Keyboard shortcuts

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