workload

package
v0.0.0-...-8517269 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CheckpointInterval = time.Duration(5000) * time.Millisecond

Delay after saving docs before saving a checkpoint to the server.

View Source
const DocsPerUser = 1000000
View Source
const FetchDelay = time.Duration(1000) * time.Millisecond

Delay between receiving first change and GETting the doc(s), to allow for batching.

View Source
const MaxFirstFetch = 200

Max number of old revisions to pull when a user's puller first starts.

Variables

View Source
var (
	GlConfig *Config

	// keep track of pushers and pullers
	Pullers = []User{}
	Pushers = []User{}
)
View Source
var DefaultConfig = Config{
	Hostname:               "127.0.0.1",
	Port:                   4984,
	AdminPort:              4985,
	DocSize:                1024,
	SendAttachment:         false,
	RampUpIntervalMs:       60000,
	RunTimeMs:              7200000,
	SleepTimeMs:            10000,
	FeedType:               "continuous",
	Verbose:                false,
	NumPullers:             7,
	NumPushers:             3,
	ChannelActiveUsers:     10,
	ChannelConcurrentUsers: 2,
	MinUserOffTimeMs:       5000,
	MaxUserOffTimeMs:       120000,
	AuthType:               "session",
	Password:               "password",
	AddDocToTargetUser:     false,
	StatsdEnabled:          false,
	StatsdEndpoint:         "localhost:8125",
}
View Source
var Verbose = false

Functions

func DocIterator

func DocIterator(start, end int, dsg *DocSizeGenerator, channel string, sendAttachment, addTargetUser bool) <-chan api.Doc

func Hash

func Hash(inString string) string

func Log

func Log(fmt string, args ...interface{})

func RandString

func RandString(key string, expectedLength int) string

func ReadConfig

func ReadConfig()

func RunNewPuller

func RunNewPuller(schedule RunSchedule, c *api.SyncGatewayClient, channel, name, feedType string, wg *sync.WaitGroup)

func RunNewPusher

func RunNewPusher(schedule RunSchedule, name string, c *api.SyncGatewayClient, channel string, size int, sendAttachment bool, dist DocSizeDistribution, seqId, sleepTime int, wg *sync.WaitGroup, addTargetUser bool)

func RunScheduleFollower

func RunScheduleFollower(schedule RunSchedule, name string, wg *sync.WaitGroup)

func StartStatsdClient

func StartStatsdClient() *statsd.Client

func StopStatsdClient

func StopStatsdClient()

func UserIterator

func UserIterator(NumPullers, NumPushers, UserOffset, ChannelActiveUsers, ChannelConcurrentUsers, MinUserOffTimeMs, MaxUserOffTimeMs, RampUpDelay, RunTimeMs int) <-chan *User

Generates all the users that will be used by this gateload run. Each new user is added to the chan that is returned.

func ValidateExpvars

func ValidateExpvars()

Types

type Config

type Config struct {
	Hostname               string
	Port                   int
	AdminPort              int
	Database               string
	ChannelActiveUsers     int
	ChannelConcurrentUsers int
	MinUserOffTimeMs       int
	MaxUserOffTimeMs       int
	NumPullers             int
	NumPushers             int
	UserOffset             int
	DocSize                int
	SendAttachment         bool
	DocSizeDistribution    DocSizeDistribution
	RampUpIntervalMs       int
	SleepTimeMs            int
	RunTimeMs              int
	FeedType               string // Type of _changes feed: "continuous" or "longpoll"
	SerieslyHostname       string
	SerieslyDatabase       string
	Verbose                bool
	LogRequests            bool
	AuthType               string
	Password               string
	AddDocToTargetUser     bool   // Grant access of doc to specific user, to trigger view queries (SG issue #825)
	StatsdEnabled          bool   // If true, will push stats to StatsdEndpoint
	StatsdEndpoint         string // The endpoint of the statds server, eg localhost:8125
}

type DocSizeDistribution

type DocSizeDistribution []*DocSizeDistributionElement

type DocSizeDistributionElement

type DocSizeDistributionElement struct {
	Prob    int
	MinSize int
	MaxSize int
}

type DocSizeGenerator

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

func NewDocSizeGenerator

func NewDocSizeGenerator(dist DocSizeDistribution) (*DocSizeGenerator, error)

func (*DocSizeGenerator) NextDocSize

func (dsg *DocSizeGenerator) NextDocSize() int

type RunInterval

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

func (*RunInterval) String

func (ri *RunInterval) String() string

type RunSchedule

type RunSchedule []*RunInterval

func (RunSchedule) Len

func (r RunSchedule) Len() int

func (RunSchedule) Less

func (r RunSchedule) Less(i, j int) bool

func (RunSchedule) String

func (r RunSchedule) String() string

func (RunSchedule) Swap

func (r RunSchedule) Swap(i, j int)

type ScheduleBuilder

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

func NewScheduleBuilder

func NewScheduleBuilder(numUsers, maxActiveUsers int, rampUpDelay, minOffTime, maxOffTime, totalRuntime time.Duration) *ScheduleBuilder

func (*ScheduleBuilder) BuildSchedules

func (s *ScheduleBuilder) BuildSchedules() []RunSchedule

type User

type User struct {
	SeqId    int
	Type     string
	Name     string
	Channel  string
	Cookie   http.Cookie
	Schedule RunSchedule
}

Jump to

Keyboard shortcuts

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