workloads

package
v0.0.0-...-47f99fb Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BatchSize int = 100

Variables

View Source
var NUM_STATES = len(STATES)
View Source
var OVERHEAD = int(450)
View Source
var STATES = [][]string{
	[]string{"AK", "Alaska"},
	[]string{"AL", "Alabama"},
	[]string{"AR", "Arkansas"},
	[]string{"AS", "American Samoa"},
	[]string{"AZ", "Arizona"},
	[]string{"CA", "California"},
	[]string{"CO", "Colorado"},
	[]string{"CT", "Connecticut"},
	[]string{"DC", "District of Columbia"},
	[]string{"DE", "Delaware"},
	[]string{"FL", "Florida"},
	[]string{"GA", "Georgia"},
	[]string{"GU", "Guam"},
	[]string{"HI", "Hawaii"},
	[]string{"IA", "Iowa"},
	[]string{"ID", "Idaho"},
	[]string{"IL", "Illinois"},
	[]string{"IN", "Indiana"},
	[]string{"KS", "Kansas"},
	[]string{"KY", "Kentucky"},
	[]string{"LA", "Louisiana"},
	[]string{"MA", "Massachusetts"},
	[]string{"MD", "Maryland"},
	[]string{"ME", "Maine"},
	[]string{"MI", "Michigan"},
	[]string{"MN", "Minnesota"},
	[]string{"MO", "Missouri"},
	[]string{"MP", "Northern Mariana Islands"},
	[]string{"MS", "Mississippi"},
	[]string{"MT", "Montana"},
	[]string{"NA", "National"},
	[]string{"NC", "North Carolina"},
	[]string{"ND", "North Dakota"},
	[]string{"NE", "Nebraska"},
	[]string{"NH", "New Hampshire"},
	[]string{"NJ", "New Jersey"},
	[]string{"NM", "New Mexico"},
	[]string{"NV", "Nevada"},
	[]string{"NY", "New York"},
	[]string{"OH", "Ohio"},
	[]string{"OK", "Oklahoma"},
	[]string{"OR", "Oregon"},
	[]string{"PA", "Pennsylvania"},
	[]string{"PR", "Puerto Rico"},
	[]string{"RI", "Rhode Island"},
	[]string{"SC", "South Carolina"},
	[]string{"SD", "South Dakota"},
	[]string{"TN", "Tennessee"},
	[]string{"TX", "Texas"},
	[]string{"UT", "Utah"},
	[]string{"VA", "Virginia"},
	[]string{"VI", "Virgin Islands"},
	[]string{"VT", "Vermont"},
	[]string{"WA", "Washington"},
	[]string{"WI", "Wisconsin"},
	[]string{"WV", "West Virginia"},
	[]string{"WY", "Wyoming"},
}

Functions

func Hash

func Hash(inString string) string

func RandString

func RandString(key string, expectedLength int) string

Types

type Config

type Config struct {
	Type                    string
	CreatePercentage        int
	ReadPercentage          int
	UpdatePercentage        int
	DeletePercentage        int
	Records                 int64
	Operations              int64
	ValueSize               int
	Workers                 int
	QueryWorkers            int
	Throughput              int
	QueryThroughput         int
	HotDataPercentage       int64
	HotSpotAccessPercentage int
	RunTime                 int
	Indexes                 []string
}

type Default

type Default struct {
	Config       Config
	DeletedItems int64
	// contains filtered or unexported fields
}

func (*Default) DoBatch

func (w *Default) DoBatch(db databases.Database, state *State, seq chan string)

func (*Default) GenerateExistingKey

func (w *Default) GenerateExistingKey(currentRecords int64) string

func (*Default) GenerateKeyForRemoval

func (w *Default) GenerateKeyForRemoval() string

func (*Default) GenerateNewKey

func (w *Default) GenerateNewKey(currentRecords int64) string

func (*Default) GenerateQueryArgs

func (w *Default) GenerateQueryArgs(key string) []interface{}

func (*Default) GenerateValue

func (w *Default) GenerateValue(key string, size int) map[string]interface{}

func (*Default) PrepareBatch

func (w *Default) PrepareBatch() []string

func (*Default) PrepareQuerySeq

func (w *Default) PrepareQuerySeq(size int64) chan string

func (*Default) PrepareSeq

func (w *Default) PrepareSeq(size int64) chan string

func (*Default) RunCRUDWorkload

func (w *Default) RunCRUDWorkload(database databases.Database,
	state *State, wg *sync.WaitGroup)

func (*Default) RunQueryWorkload

func (w *Default) RunQueryWorkload(database databases.Database,
	state *State, wg *sync.WaitGroup)

func (*Default) SetImplementation

func (w *Default) SetImplementation(i Workload)

type HotSpot

type HotSpot struct {
	Config       Config
	DeletedItems int64
	Default
}

func (*HotSpot) GenerateExistingKey

func (w *HotSpot) GenerateExistingKey(currentRecords int64) string

type N1QL

type N1QL struct {
	Config       Config
	DeletedItems int64
	Zipf         rand.Zipf
	Default
}

func (*N1QL) GenerateExistingKey

func (w *N1QL) GenerateExistingKey(currentRecords int64) string

func (*N1QL) GenerateKeyForRemoval

func (w *N1QL) GenerateKeyForRemoval() string

func (*N1QL) GenerateNewKey

func (w *N1QL) GenerateNewKey(currentRecords int64) string

func (*N1QL) GenerateQueryArgs

func (w *N1QL) GenerateQueryArgs(key string) []interface{}

func (*N1QL) GenerateValue

func (w *N1QL) GenerateValue(key string, size int) map[string]interface{}

func (*N1QL) RandSize

func (w *N1QL) RandSize(size int) int

type State

type State struct {
	Operations, Records int64
	Errors              map[string]int
	Events              map[string]time.Time
	Latency             map[string][]float64
}

func (*State) Init

func (state *State) Init()

func (*State) MeasureLatency

func (state *State) MeasureLatency(database databases.Database,
	workload Workload, config Config, wg *sync.WaitGroup)

func (*State) ReportSummary

func (state *State) ReportSummary()

func (*State) ReportThroughput

func (state *State) ReportThroughput(config Config, wg *sync.WaitGroup)

type Workload

type Workload interface {
	SetImplementation(i Workload)

	GenerateNewKey(currentRecords int64) string

	GenerateExistingKey(currentRecords int64) string

	GenerateKeyForRemoval() string

	GenerateValue(key string, size int) map[string]interface{}

	GenerateQueryArgs(key string) []interface{}

	PrepareBatch() []string

	PrepareSeq(size int64) chan string

	DoBatch(database databases.Database, state *State, seq chan string)

	RunCRUDWorkload(database databases.Database, state *State, wg *sync.WaitGroup)

	RunQueryWorkload(database databases.Database, state *State, wg *sync.WaitGroup)
}

Jump to

Keyboard shortcuts

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