Documentation ¶
Index ¶
- Constants
- func ConnectToDB(driverName, dataSource string) *sqlx.DB
- func LoadPosts(cfg *LoadTestConfig, driverName, dataSource string)
- func ReadConfig() error
- func RunProfile(pprofUrl string, profileLength int)
- func RunTest(test *TestRun) error
- func ThreadSplit(arrayLen int, numThreads int, action func(int))
- type ChannelImportData
- type ClientTimingStats
- func (ts *ClientTimingStats) AddRouteSample(route string, duration int64, status int)
- func (ts *ClientTimingStats) AddTimingReport(timingReport TimedRoundTripperReport)
- func (ts *ClientTimingStats) CalcResults()
- func (ts *ClientTimingStats) CountResults() int
- func (ts *ClientTimingStats) GetScore() float64
- func (ts *ClientTimingStats) Merge(timings *ClientTimingStats) *ClientTimingStats
- func (ts *ClientTimingStats) Reset()
- type ConnectionConfiguration
- type DirectChannelImportData
- type EmojiImportData
- type EntityConfig
- func (config *EntityConfig) GetTeamChannelId(teamName, channelName string) (string, error)
- func (config *EntityConfig) SendStatus(status int, err error, details string)
- func (config *EntityConfig) SendStatusActionRecieve(details string)
- func (config *EntityConfig) SendStatusActionSend(details string)
- func (config *EntityConfig) SendStatusActive(details string)
- func (config *EntityConfig) SendStatusError(err error, details string)
- func (config *EntityConfig) SendStatusFailedActive(err error, details string)
- func (config *EntityConfig) SendStatusFailedLaunch(err error, details string)
- func (config *EntityConfig) SendStatusLaunching()
- func (config *EntityConfig) SendStatusStopped(details string)
- type GenerateBulkloadFileResult
- type Instance
- type LayoutChannel
- type LayoutTeam
- type LineImportData
- type LoadTestConfig
- type LoadtestEnviromentConfig
- type LoggerSettings
- type MattermostLocalConnection
- type MattermostSSHConnection
- type OrganizationLayout
- type PostImportData
- type ResultsConfiguration
- type RoleImportData
- type RouteStatResults
- type RouteStats
- type SchemeImportData
- type ServerCLICommandRunner
- type ServerSetupData
- type TeamImportData
- type TestRun
- type TimedRoundTripper
- type TimedRoundTripperReport
- type UserChannelImportData
- type UserEntitiesConfiguration
- type UserEntity
- type UserEntityRates
- type UserEntityStat
- type UserEntityStatistics
- type UserEntityStatusReport
- type UserEntityWithRateMultiplier
- type UserImportData
- type UserTeamImportData
- type VersionImportData
Constants ¶
View Source
const ( DEFAULT_PERMISSIONS_TEAM_ADMIN = "" /* 224-byte string literal not displayed */ DEFAULT_PERMISSIONS_TEAM_USER = "" /* 255-byte string literal not displayed */ DEFAULT_PERMISSIONS_CHANNEL_ADMIN = "manage_channel_roles" DEFAULT_PERMISSIONS_CHANNEL_USER = "" /* 183-byte string literal not displayed */ )
View Source
const ( InstanceHeartbeatInterval = 30 * time.Second InstanceExpiredInterval = InstanceHeartbeatInterval * 4 )
View Source
const ( HIGH_VOLUME = 1 MID_VOLUME = 2 LOW_VOLUME = 3 )
View Source
const ( STATUS_LAUNCHING int = iota STATUS_ACTIVE int = iota STATUS_STOPPED int = iota STATUS_ERROR int = iota STATUS_FAILED_LAUNCH int = iota STATUS_FAILED_ACTIVE int = iota STATUS_ACTION_SEND int = iota STATUS_ACTION_RECIEVE int = iota )
View Source
const CHANNELS_CHUNK_SIZE = 50
View Source
const CHANNELS_FETCH_SIZE = CHANNELS_CHUNK_SIZE * 2
View Source
const (
OPENGRAPH_TEST_URL = "https://s3.amazonaws.com/mattermost-load-test-media/index.html"
)
Variables ¶
This section is empty.
Functions ¶
func ConnectToDB ¶
func LoadPosts ¶
func LoadPosts(cfg *LoadTestConfig, driverName, dataSource string)
func ReadConfig ¶
func ReadConfig() error
func RunProfile ¶
func ThreadSplit ¶
Types ¶
type ChannelImportData ¶
type ClientTimingStats ¶
type ClientTimingStats struct {
Routes map[string]*RouteStats
}
func NewClientTimingStats ¶
func NewClientTimingStats() *ClientTimingStats
func (*ClientTimingStats) AddRouteSample ¶
func (ts *ClientTimingStats) AddRouteSample(route string, duration int64, status int)
func (*ClientTimingStats) AddTimingReport ¶
func (ts *ClientTimingStats) AddTimingReport(timingReport TimedRoundTripperReport)
func (*ClientTimingStats) CalcResults ¶
func (ts *ClientTimingStats) CalcResults()
func (*ClientTimingStats) CountResults ¶
func (ts *ClientTimingStats) CountResults() int
CountResults returns the total number of results measure across all routes.
func (*ClientTimingStats) GetScore ¶
func (ts *ClientTimingStats) GetScore() float64
Score is the average of the 95th percentile, median and interquartile range of all routes.
func (*ClientTimingStats) Merge ¶
func (ts *ClientTimingStats) Merge(timings *ClientTimingStats) *ClientTimingStats
func (*ClientTimingStats) Reset ¶
func (ts *ClientTimingStats) Reset()
Reset removes all measured results.
type ConnectionConfiguration ¶
type ConnectionConfiguration struct { ServerURL string WebsocketURL string PProfURL string DriverName string DataSource string DBEndpoint string // deprecated LocalCommands bool SSHHostnamePort string SSHUsername string SSHPassword string SSHKey string MattermostInstallDir string ConfigFileLoc string AdminEmail string AdminPassword string SkipBulkload bool MaxIdleConns int MaxIdleConnsPerHost int IdleConnTimeoutMilliseconds int }
type DirectChannelImportData ¶
type EmojiImportData ¶
type EntityConfig ¶
type EntityConfig struct { EntityNumber int EntityName string EntityActions []randutil.Choice UserData UserImportData Users []UserImportData ChannelMap map[string]map[string]string TeamMap map[string]string TownSquareMap map[string]string Client *model.Client4 AdminClient *model.Client4 WebSocketClient *model.WebSocketClient ActionRate time.Duration LoadTestConfig *LoadTestConfig StatusReportChannel chan<- UserEntityStatusReport StopChannel <-chan bool StopWaitGroup *sync.WaitGroup Info map[string]interface{} // contains filtered or unexported fields }
func (*EntityConfig) GetTeamChannelId ¶
func (config *EntityConfig) GetTeamChannelId(teamName, channelName string) (string, error)
func (*EntityConfig) SendStatus ¶
func (config *EntityConfig) SendStatus(status int, err error, details string)
func (*EntityConfig) SendStatusActionRecieve ¶
func (config *EntityConfig) SendStatusActionRecieve(details string)
func (*EntityConfig) SendStatusActionSend ¶
func (config *EntityConfig) SendStatusActionSend(details string)
func (*EntityConfig) SendStatusActive ¶
func (config *EntityConfig) SendStatusActive(details string)
func (*EntityConfig) SendStatusError ¶
func (config *EntityConfig) SendStatusError(err error, details string)
func (*EntityConfig) SendStatusFailedActive ¶
func (config *EntityConfig) SendStatusFailedActive(err error, details string)
func (*EntityConfig) SendStatusFailedLaunch ¶
func (config *EntityConfig) SendStatusFailedLaunch(err error, details string)
func (*EntityConfig) SendStatusLaunching ¶
func (config *EntityConfig) SendStatusLaunching()
func (*EntityConfig) SendStatusStopped ¶
func (config *EntityConfig) SendStatusStopped(details string)
type GenerateBulkloadFileResult ¶
type GenerateBulkloadFileResult struct { File bytes.Buffer Users []UserImportData Teams []TeamImportData Channels []ChannelImportData Schemes []SchemeImportData Emojis []EmojiImportData }
func GenerateBulkloadFile ¶
func GenerateBulkloadFile(config *LoadtestEnviromentConfig) GenerateBulkloadFileResult
type Instance ¶
type Instance struct { Id string Index int EntityStartNum int Seed int64 // contains filtered or unexported fields }
Instance represents a running instance of a loadtest.
type LayoutChannel ¶
type LayoutChannel struct {
Num int
}
type LayoutTeam ¶
type LayoutTeam struct { Num int Volume int Channels []LayoutChannel }
type LineImportData ¶
type LineImportData struct { Type string `json:"type"` Scheme *SchemeImportData `json:"scheme,omitempty"` Team *TeamImportData `json:"team,omitempty"` Channel *ChannelImportData `json:"channel,omitempty"` User *UserImportData `json:"user,omitempty"` Post *PostImportData `json:"post,omitempty"` DirectChannel *DirectChannelImportData `json:"direct_channel,omitempty"` Emoji *EmojiImportData `json:"emoji,omitempty"` Version int `json:"version"` }
type LoadTestConfig ¶
type LoadTestConfig struct { LoadtestEnviromentConfig LoadtestEnviromentConfig ConnectionConfiguration ConnectionConfiguration UserEntitiesConfiguration UserEntitiesConfiguration ResultsConfiguration ResultsConfiguration LogSettings LoggerSettings }
func GetConfig ¶
func GetConfig() (*LoadTestConfig, error)
type LoadtestEnviromentConfig ¶
type LoadtestEnviromentConfig struct { NumTeams int NumChannelsPerTeam int NumPrivateChannelsPerTeam int NumDirectMessageChannels int NumGroupMessageChannels int NumUsers int NumTeamSchemes int NumChannelSchemes int NumEmoji int NumPlugins int PercentHighVolumeChannels float64 PercentMidVolumeChannels float64 PercentLowVolumeChannels float64 PercentUsersHighVolumeChannel float64 PercentUsersMidVolumeChannel float64 PercentUsersLowVolumeChannel float64 PercentHighVolumeTeams float64 PercentMidVolumeTeams float64 PercentLowVolumeTeams float64 PercentUsersHighVolumeTeams float64 PercentUsersMidVolumeTeams float64 PercentUsersLowVolumeTeams float64 HighVolumeTeamSelectionWeight int MidVolumeTeamSelectionWeight int LowVolumeTeamSelectionWeight int HighVolumeChannelSelectionWeight int MidVolumeChannelSelectionWeight int LowVolumeChannelSelectionWeight int NumPosts int PostTimeRange int64 ReplyChance float64 PercentCustomSchemeTeams float64 PercentCustomSchemeChannels float64 }
type LoggerSettings ¶
type MattermostLocalConnection ¶
type MattermostLocalConnection struct {
// contains filtered or unexported fields
}
func NewLocalConnection ¶
func NewLocalConnection(mattermostInstallDir string) (*MattermostLocalConnection, error)
func (*MattermostLocalConnection) Close ¶
func (c *MattermostLocalConnection) Close() error
func (*MattermostLocalConnection) RunCommand ¶
func (c *MattermostLocalConnection) RunCommand(command string) (bool, string)
func (*MattermostLocalConnection) RunPlatformCommand ¶
func (c *MattermostLocalConnection) RunPlatformCommand(args string) (bool, string)
func (*MattermostLocalConnection) SendLoadtestFile ¶
func (c *MattermostLocalConnection) SendLoadtestFile(buf *bytes.Buffer) error
type MattermostSSHConnection ¶
type MattermostSSHConnection struct { Client *ssh.Client // contains filtered or unexported fields }
func ConnectSSH ¶
func ConnectSSH(sshHostnamePort, sshKey, sshUsername, sshPassword, mattermostInstallDir string, configFileLoc string) (*MattermostSSHConnection, error)
func (*MattermostSSHConnection) Close ¶
func (c *MattermostSSHConnection) Close() error
func (*MattermostSSHConnection) RunCommand ¶
func (c *MattermostSSHConnection) RunCommand(command string) (bool, string)
func (*MattermostSSHConnection) RunPlatformCommand ¶
func (c *MattermostSSHConnection) RunPlatformCommand(args string) (bool, string)
func (*MattermostSSHConnection) SendLoadtestFile ¶
func (c *MattermostSSHConnection) SendLoadtestFile(buf *bytes.Buffer) error
type OrganizationLayout ¶
type OrganizationLayout struct { Config *LoadtestEnviromentConfig TeamNameToIdMap map[string]string ChannelNameToIdMap map[string]string // Assumes unique channel names }
type PostImportData ¶
type ResultsConfiguration ¶
type RoleImportData ¶
type RouteStatResults ¶
type RouteStats ¶
type RouteStats struct { Name string NumHits int64 NumErrors int64 ErrorRate float64 Duration []float64 DurationLastMinute *ratecounter.AvgRateCounter `json:"-"` Max float64 Min float64 Mean float64 Median float64 Percentile90 float64 Percentile95 float64 InterQuartileRange float64 }
func NewRouteStats ¶
func NewRouteStats(name string) *RouteStats
func (*RouteStats) AddSample ¶
func (s *RouteStats) AddSample(duration int64, status int)
func (*RouteStats) CalcResults ¶
func (s *RouteStats) CalcResults()
func (*RouteStats) Merge ¶
func (s *RouteStats) Merge(other *RouteStats) *RouteStats
type SchemeImportData ¶
type SchemeImportData struct { Name string `json:"name"` DisplayName string `json:"display_name"` Description string `json:"description"` Scope string `json:"scope"` DefaultTeamAdminRole *RoleImportData `json:"default_team_admin_role,omitempty"` DefaultTeamUserRole *RoleImportData `json:"default_team_user_role,omitempty"` DefaultChannelAdminRole *RoleImportData `json:"default_channel_admin_role,omitempty"` DefaultChannelUserRole *RoleImportData `json:"default_channel_user_role,omitempty"` }
type ServerCLICommandRunner ¶
type ServerSetupData ¶
type ServerSetupData struct { // TeamIdMap maps team name to team id TeamIdMap map[string]string // ChannelIdMap maps team name and channel name to channel id ChannelIdMap map[string]map[string]string // TownSquareIdMap maps team name to the channel id of the corresponding default channel. TownSquareIdMap map[string]string BulkloadResult GenerateBulkloadFileResult }
func SetupServer ¶
func SetupServer(cfg *LoadTestConfig) (*ServerSetupData, error)
type TeamImportData ¶
type TestRun ¶
var TestAll TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: standardUserEntity, RateMultiplier: 1.0, }, Weight: 90, }, { Item: UserEntityWithRateMultiplier{ Entity: webhookUserEntity, RateMultiplier: 1.5, }, Weight: 10, }, }, }
var TestAutocomplete TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ RateMultiplier: 1.0, Entity: standardUserEntity, }, Weight: 10.0, }, { Item: UserEntityWithRateMultiplier{ RateMultiplier: 1.0, Entity: autocompleterUserEntity, }, Weight: 90.0, }, }, }
var TestBasicPosting TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: posterEntity, RateMultiplier: 1.0, }, Weight: 100, }, }, }
var TestChannelCreateDelete TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: channelCreateDeleteEntity, RateMultiplier: 1.0, }, Weight: 100, }, }, }
var TestDeactivation TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: standardUserEntity, RateMultiplier: 1.0, }, Weight: 70, }, { Item: UserEntityWithRateMultiplier{ Entity: deactivatingUserEntity, RateMultiplier: 1.0, }, Weight: 30, }, }, }
var TestGetChannel TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: getChannelEntity, RateMultiplier: 1.0, }, Weight: 100, }, }, }
var TestLeaveJoinChannel TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: standardUserEntity, RateMultiplier: 1.0, }, Weight: 90, }, { Item: UserEntityWithRateMultiplier{ Entity: channelLeaverJoinerUserEntity, RateMultiplier: 1.0, }, Weight: 10, }, }, }
var TestLeaveJoinTeam TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: standardUserEntity, RateMultiplier: 1.0, }, Weight: 90, }, { Item: UserEntityWithRateMultiplier{ Entity: teamLeaverJoinerUserEntity, RateMultiplier: 1.0, }, Weight: 10, }, }, }
var TestMoreChannelsBrowser TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: standardUserEntity, RateMultiplier: 1.0, }, Weight: 70, }, { Item: UserEntityWithRateMultiplier{ Entity: moreChannelsEntity, RateMultiplier: 1.0, }, Weight: 30, }, }, }
var TestPostReactions TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: reactionsPoster, RateMultiplier: 1.0, }, Weight: 100, }, }, }
var TestSearch TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: searchEntity, RateMultiplier: 1.0, }, Weight: 100, }, }, }
var TestSearchUsers TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: searchUsersEntity, RateMultiplier: 1.0, }, Weight: 100, }, }, }
var TestTownSquareSpam TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: standardUserEntity, RateMultiplier: 1.0, }, Weight: 90, }, { Item: UserEntityWithRateMultiplier{ Entity: townSquareSpammerUserEntity, RateMultiplier: 1.0, }, Weight: 10, }, }, }
var TestUpdateUserProfile TestRun = TestRun{ UserEntities: []randutil.Choice{ { Item: UserEntityWithRateMultiplier{ Entity: updateUserProfileEntity, RateMultiplier: 1.0, }, Weight: 100, }, }, }
type TimedRoundTripper ¶
type TimedRoundTripper struct {
// contains filtered or unexported fields
}
func NewTimedRoundTripper ¶
func NewTimedRoundTripper(reportChan chan<- TimedRoundTripperReport) *TimedRoundTripper
type TimedRoundTripperReport ¶
type UserChannelImportData ¶
type UserEntitiesConfiguration ¶
type UserEntitiesConfiguration struct { TestLengthMinutes int NumActiveEntities int ActionRateMilliseconds int ActionRateMaxVarianceMilliseconds int EnableRequestTiming bool ChannelLinkChance float64 UploadImageChance float64 LinkPreviewChance float64 CustomEmojiChance float64 CustomEmojiReactionChance float64 SystemEmojiReactionChance float64 NeedsProfilesByIdChance float64 NeedsProfilesByUsernameChance float64 NeedsProfileStatusChance float64 DoStatusPolling bool RandomizeEntitySelection bool UserProfileUpdateFullnameChance float64 UserProfileUpdateUsernameChance float64 UserProfileUpdateNicknameChance float64 UserProfileUpdatePositionChance float64 UserProfileUpdateEmailChance float64 UserProfileUpdateImageChance float64 PublicChannelCreationChance float64 PrivateChannelCreationChance float64 DirectChannelCreationChance float64 GroupChannelCreationChance float64 NumPostReactionsPerUser int PostReactionsRateMilliseconds int NumPostsGetBeforeAfter int GetPostsAroundLastUnreadChance float64 NumGetPostsAroundLastUnread int }
type UserEntity ¶
type UserEntityRates ¶
type UserEntityRates struct { RateDescription string ErrorRate *ratecounter.RateCounter ActionSendRate *ratecounter.RateCounter ActionRecieveRate *ratecounter.RateCounter }
func NewUserEntityRates ¶
func NewUserEntityRates(interval time.Duration, intervalDescription string) UserEntityRates
func (*UserEntityRates) String ¶
func (rates *UserEntityRates) String() string
type UserEntityStat ¶
type UserEntityStatistics ¶
type UserEntityStatistics struct { StartTime time.Time TotalErrors UserEntityStat TotalEntitiesActive UserEntityStat TotalEntitiesLaunching UserEntityStat TotalEntitiesFailedLaunch UserEntityStat TotalEntitiesFailedActive UserEntityStat TotalEntitiesStopped UserEntityStat UserEntityRatesPerSecond UserEntityRates UserEntityRatesPerMinute UserEntityRates UserEntityRatesPerHour UserEntityRates RouteTimings map[string]ewma.MovingAverage Routes []string }
func NewUserEntityStatistics ¶
func NewUserEntityStatistics() *UserEntityStatistics
type UserEntityStatusReport ¶
type UserEntityStatusReport struct { Status int Err error Details string Config *EntityConfig }
type UserEntityWithRateMultiplier ¶
type UserEntityWithRateMultiplier struct { Entity UserEntity RateMultiplier float64 }
type UserImportData ¶
type UserImportData struct { Username string `json:"username"` Email string `json:"email"` AuthService string `json:"auth_service,omitempty"` AuthData string `json:"auth_data,omitempty"` Password string `json:"password,omitempty"` Nickname string `json:"nickname,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Position string `json:"position,omitempty"` Roles string `json:"roles"` Locale string `json:"locale,omitempty"` Teams []UserTeamImportData `json:"teams"` TeamChoice []randutil.Choice `json:"-"` Theme string `json:"theme,omitempty"` SelectedFont string `json:"display_font,omitempty"` UseMilitaryTime string `json:"military_time,omitempty"` NameFormat string `json:"teammate_name_display,omitempty"` CollapsePreviews string `json:"link_previews,omitempty"` MessageDisplay string `json:"message_display,omitempty"` ChannelDisplayMode string `json:"channel_display_mode,omitempty"` }
func PickUser ¶
func PickUser(users []UserImportData, r *rand.Rand) *UserImportData
func (*UserImportData) PickTeam ¶
func (s *UserImportData) PickTeam(r *rand.Rand) *UserTeamImportData
func (*UserImportData) PickTeamChannel ¶
func (s *UserImportData) PickTeamChannel(r *rand.Rand) (*UserTeamImportData, *UserChannelImportData)
type UserTeamImportData ¶
type UserTeamImportData struct { Name string `json:"name"` Roles string `json:"roles"` Channels []UserChannelImportData `json:"channels"` ChannelChoice []randutil.Choice `json:"-"` }
func (*UserTeamImportData) PickChannel ¶
func (team *UserTeamImportData) PickChannel(r *rand.Rand) *UserChannelImportData
type VersionImportData ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.