traffic

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

package traffic generates filesystem traffic useful for testing and benchmarking

Index

Constants

View Source
const (
	File   Object = iota
	Commit        = iota
	Branch        = iota
)

Variables

This section is empty.

Functions

func RandWord

func RandWord(n int, rand *rand.Rand) string

Generates a random sequence of letters. Useful for making filesystems that won't interfere with each other. This should be factored out to another file.

Types

type Object

type Object int

Object enumerates the objects that exist in a filesystem

type Op

type Op struct {
	RW     RW
	Object Object
	Path   string
	Commit string
	Branch string
	Data   string
}

Op describes an operation on a filesystem

type RW

type RW int

RW indicates if the operation is a read or a write

const (
	R RW = iota
	W    = iota
)

type Workload

type Workload []Op

Workload describe work to be done on the server. We generate workloads in specific ways such that read operations (o.RW == R) can be taken as facts about the system. For example a read operation on a file will indicate with its Data file what the file should look like right now

func (Workload) Facts

func (w Workload) Facts() Workload

Computes Facts that can be derived from a workload. Facts are read Ops that should perform as true.

func (Workload) FileValue

func (w Workload) FileValue(path, commit, branch string) string

func (Workload) Generate

func (w Workload) Generate(rand *rand.Rand, size int) reflect.Value

Jump to

Keyboard shortcuts

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