Documentation ¶
Index ¶
- Constants
- Variables
- func CheckFecthRegisterAndLogin(ctx context.Context, state *State) error
- func CheckFecthUnreadCount(ctx context.Context, state *State) error
- func CheckGetAddChannel(ctx context.Context, state *State) error
- func CheckGetChannel(ctx context.Context, state *State) error
- func CheckGetHistory(ctx context.Context, state *State, chanID int, mode PageFollowMode) error
- func CheckGetProfileFail(ctx context.Context, state *State) error
- func CheckLogin(ctx context.Context, state *State) error
- func CheckMessageScenario(ctx context.Context, state *State) error
- func CheckNotLoggedInUser(ctx context.Context, state *State) error
- func CheckPostAddChannel(ctx context.Context, state *State) (int, error)
- func CheckPostAddChannelFail(ctx context.Context, state *State) error
- func CheckRegisterProfile(ctx context.Context, state *State) error
- func CheckStaticFiles(ctx context.Context, state *State) error
- func GenerateInitialDataSetSQL(outputPath string)
- func GetBuffer() *bytes.Buffer
- func GetCheckerErrors() []error
- func GetLastCheckerError() (err error, t time.Time)
- func GetLastSlowPath() (path string, t time.Time)
- func GetRandomTargetHost() string
- func GetTargetHosts() []string
- func GuardCheckerError(guard bool)
- func LoadGetChannel(ctx context.Context, state *State) error
- func LoadGetHistory(ctx context.Context, state *State) error
- func LoadProfile(ctx context.Context, state *State) error
- func LoadReadOnlyUser(ctx context.Context, state *State, chanID int) error
- func LoadReadWriteUser(ctx context.Context, state *State, chanID int) error
- func LoadRegister(ctx context.Context, state *State) error
- func PrepareDataSet()
- func PutBuffer(buf *bytes.Buffer)
- func RandomAlphabetString(n int) string
- func RandomText() string
- func SetTargetHosts(target []string)
- type AppUser
- type Avatar
- type BenchDataSet
- type Channel
- type CheckAction
- type Checker
- type CheckerError
- type CheckerTransport
- type JsonMessage
- type JsonUnreadInfo
- type JsonUser
- type MessageInfo
- type PageFollowMode
- type State
- func (s *State) AddChannel(id int, c *Channel)
- func (s *State) AddSendMessage(x *MessageInfo) (func(), bool)
- func (s *State) DistributeTmpChannelIDs()
- func (s *State) FindUserByName(name string) (*AppUser, bool)
- func (s *State) GetActiveChannelID() int
- func (s *State) GetChannel(chanID int) (*Channel, bool)
- func (s *State) GetChecker(u *AppUser) *Checker
- func (s *State) GetInactiveChannelID() int
- func (s *State) GetMsgCheckChannelID() int
- func (s *State) GetRandomChannelID() int
- func (s *State) Init()
- func (s *State) PopNewUser() (*AppUser, *Checker, func())
- func (s *State) PopRandomUser() (*AppUser, *Checker, func())
- func (s *State) PushUser(u *AppUser)
- func (s *State) SnapshotMessageCount() (map[int]int, map[int]int)
- func (s *State) TotalChannelCount() int
- func (s *State) ValidateHistoryMessage(chanID int, userName string, msg string, date string) error
- func (s *State) ValidateJsonMessage(chanID int, msg *JsonMessage) error
- type StaticFile
Constants ¶
View Source
const IsubataAppHost = "isubata.example.com"
Variables ¶
View Source
var ( RedirectAttemptedError = fmt.Errorf("redirect attempted") RequestTimeoutError = fmt.Errorf("リクエストがタイムアウトしました") UserAgent = "isucon7q-benchmarker" GetTimeout = 10 * time.Second PostTimeout = 3 * time.Second InitializeTimeout = 10 * time.Second SlowThreshold = 1000 * time.Millisecond MaxCheckerRequest = 6 DebugMode = false )
View Source
var ( StaticFiles = []*StaticFile{ &StaticFile{"/css/bootstrap.min.css", 150996, "7e923ad223e9f33e54d22e50cf2bcce5"}, &StaticFile{"/css/main.css", 1741, "d8c2a974e5816bd9f839f84a77348970"}, &StaticFile{"/favicon.ico", 318, "7157dc4688c274fe0bc2e3122cac19c9"}, &StaticFile{"/fonts/glyphicons-halflings-regular.eot", 20127, "f4769f9bdb7466be65088239c12046d1"}, &StaticFile{"/fonts/glyphicons-halflings-regular.svg", 108738, "89889688147bd7575d6327160d64e760"}, &StaticFile{"/fonts/glyphicons-halflings-regular.ttf", 45404, "e18bbf611f2a2e43afc071aa2f4e1512"}, &StaticFile{"/fonts/glyphicons-halflings-regular.woff", 23424, "fa2772327f55d8198301fdb8bcfc8158"}, &StaticFile{"/fonts/glyphicons-halflings-regular.woff2", 18028, "448c34a56d699c29117adc64c43affeb"}, &StaticFile{"/js/bootstrap.min.js", 46653, "0827a0bdcd9a917990eee461a77dd33e"}, &StaticFile{"/js/chat.js", 4162, "c557e68d34fdfb347fa4cf00e1eba7bd"}, &StaticFile{"/js/jquery.min.js", 86659, "c9f5aeeca3ad37bf2aa006139b935f0a"}, &StaticFile{"/js/tether.min.js", 24632, "1c4a5999a2b43cdd3aaa88a04f24c961"}, } )
Functions ¶
func CheckFecthRegisterAndLogin ¶
fetch 検証用のユーザ作成
func CheckGetHistory ¶
func CheckPostAddChannelFail ¶
func GenerateInitialDataSetSQL ¶
func GenerateInitialDataSetSQL(outputPath string)
func GetCheckerErrors ¶
func GetCheckerErrors() []error
func GetLastCheckerError ¶
func GetLastSlowPath ¶
func GetRandomTargetHost ¶
func GetRandomTargetHost() string
func GetTargetHosts ¶
func GetTargetHosts() []string
func GuardCheckerError ¶
func GuardCheckerError(guard bool)
func LoadReadWriteUser ¶
func PrepareDataSet ¶
func PrepareDataSet()
func RandomAlphabetString ¶
func RandomText ¶
func RandomText() string
func SetTargetHosts ¶
func SetTargetHosts(target []string)
Types ¶
type BenchDataSet ¶
type BenchDataSet struct { Users []*AppUser NewUsers []*AppUser Channels []*Channel NewChannels []*Channel Avatars []*Avatar LargeAvatars []*Avatar DefaultAvatar *Avatar Texts []string Messages []*MessageInfo }
var ( DataPath = "./data" DataSet BenchDataSet )
type CheckAction ¶
type CheckAction struct { Method string Path string ContentType string PostBody io.Reader // for "multipart/form-data" PostData map[string]string // for "application/x-www-form-urlencoded" Headers map[string]string ExpectedStatusCode int ExpectedLocation *regexp.Regexp ExpectedHeaders map[string]string Description string CheckFunc func(*http.Response, *bytes.Buffer) error EnableCache bool SkipIfCacheAvailable bool DisableSlowChecking bool }
type Checker ¶
type Checker struct { Client *http.Client Cache *urlcache.CacheStore // contains filtered or unexported fields }
func NewChecker ¶
func NewChecker() *Checker
func (*Checker) NewRequest ¶
func (*Checker) ResetCookie ¶
func (c *Checker) ResetCookie()
type CheckerError ¶
type CheckerError struct {
// contains filtered or unexported fields
}
func (*CheckerError) Error ¶
func (e *CheckerError) Error() string
func (*CheckerError) IsFatal ¶
func (e *CheckerError) IsFatal() bool
func (*CheckerError) IsTimeout ¶
func (e *CheckerError) IsTimeout() bool
type CheckerTransport ¶
type CheckerTransport struct {
// contains filtered or unexported fields
}
type JsonMessage ¶
type JsonUnreadInfo ¶
type MessageInfo ¶
type PageFollowMode ¶
type PageFollowMode int
const ( FollowModeRandom PageFollowMode = iota FollowModeHead FollowModeTail )
type State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) AddChannel ¶
func (*State) AddSendMessage ¶
func (s *State) AddSendMessage(x *MessageInfo) (func(), bool)
func (*State) DistributeTmpChannelIDs ¶
func (s *State) DistributeTmpChannelIDs()
func (*State) GetActiveChannelID ¶
func (*State) GetChecker ¶
func (*State) GetInactiveChannelID ¶
func (*State) GetMsgCheckChannelID ¶
func (*State) GetRandomChannelID ¶
func (*State) PopNewUser ¶
func (*State) PopRandomUser ¶
func (*State) SnapshotMessageCount ¶
func (*State) TotalChannelCount ¶
func (*State) ValidateHistoryMessage ¶
func (*State) ValidateJsonMessage ¶
func (s *State) ValidateJsonMessage(chanID int, msg *JsonMessage) error
type StaticFile ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.