Documentation ¶
Index ¶
- Constants
- Variables
- func DocIterator(start, end int, dsg *DocSizeGenerator, channel string, ...) <-chan api.Doc
- func Hash(inString string) string
- func Log(fmt string, args ...interface{})
- func RandString(key string, expectedLength int) string
- func ReadConfig()
- func RunNewPuller(schedule RunSchedule, c *api.SyncGatewayClient, channel, name, feedType string, ...)
- func RunNewPusher(schedule RunSchedule, name string, c *api.SyncGatewayClient, channel string, ...)
- func RunScheduleFollower(schedule RunSchedule, name string, wg *sync.WaitGroup)
- func StartStatsdClient() *statsd.Client
- func StopStatsdClient()
- func UserIterator(...) <-chan *User
- func ValidateExpvars()
- type Config
- type DocSizeDistribution
- type DocSizeDistributionElement
- type DocSizeGenerator
- type RunInterval
- type RunSchedule
- type ScheduleBuilder
- type User
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 RandString ¶
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 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
Click to show internal directories.
Click to hide internal directories.