Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAddUser(ctx context.Context, state *State) error
- func CheckImage(ctx context.Context, state *State) error
- func CheckLayout(ctx context.Context, state *State) error
- func CheckLayoutPreTest(ctx context.Context, state *State) error
- func CheckLogin(ctx context.Context, state *State) error
- func CheckNotLoggedInUser(ctx context.Context, state *State) error
- func CheckOrder(ctx context.Context, state *State) error
- func CheckStaticFiles(ctx context.Context, state *State) error
- func CheckValidation(ctx context.Context, state *State) error
- 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 LoadPostOperation(ctx context.Context, state *State) error
- func LoadReadOperation(ctx context.Context, state *State) error
- func LoadUserOperation(ctx context.Context, state *State) error
- func PreAddUser(ctx context.Context, state *State) error
- func PrepareDataSet()
- func PutBuffer(buf *bytes.Buffer)
- func RandomAlphabetString(n int) string
- func SetTargetHosts(target []string)
- type AppUser
- type BenchDataSet
- type CheckAction
- type Checker
- func (c *Checker) NewRequest(method, uri string, body io.Reader) (*http.Request, error)
- func (c *Checker) OnError(a *CheckAction, req *http.Request, err error) error
- func (c *Checker) Play(ctx context.Context, a *CheckAction) error
- func (c *Checker) PlayReturnRedirect(ctx context.Context, a *CheckAction) (string, error)
- func (c *Checker) ResetCookie()
- type CheckerError
- type CheckerTransport
- type State
- type StaticFile
- type StaticFileImage
- type UploadFileImage
Constants ¶
View Source
const HisubaAppHost = "127.0.0.1:8000"
Variables ¶
View Source
var ( RedirectAttemptedError = fmt.Errorf("redirect attempted") RequestTimeoutError = fmt.Errorf("リクエストがタイムアウトしました") UserAgent = "hisucon2019-benchmarker" GetTimeout = 15 * time.Second PostTimeout = 3 * time.Second InitializeTimeout = 25 * time.Second SlowThreshold = 1000 * time.Millisecond MaxCheckerRequest = 6 DebugMode = false )
View Source
var ( StaticFiles = []*StaticFile{ &StaticFile{"/static/css/main.css"}, &StaticFile{"/static/css/bootstrap.min.css"}, } StaticFileImages = []*StaticFileImage{}/* 103 elements not displayed */ UploadFileImages = []*UploadFileImage{ &UploadFileImage{"/images/f_f_business_14_s512_f_business_14_0bg.png"}, &UploadFileImage{"/images/f_f_business_1_s512_f_business_1_0bg.png"}, &UploadFileImage{"/images/f_f_business_23_s512_f_business_23_0bg.png"}, &UploadFileImage{"/images/f_f_business_32_s512_f_business_32_0bg.png"}, &UploadFileImage{"/images/f_f_business_33_s512_f_business_33_0bg.png"}, &UploadFileImage{"/images/f_f_business_36_s512_f_business_36_0bg.png"}, &UploadFileImage{"/images/f_f_business_3_s512_f_business_3_0bg.png"}, &UploadFileImage{"/images/f_f_business_46_s512_f_business_46_0bg.png"}, &UploadFileImage{"/images/f_f_business_48_s512_f_business_48_0bg.png"}, &UploadFileImage{"/images/f_f_business_4_s512_f_business_4_0bg.png"}, &UploadFileImage{"/images/f_f_business_52_s512_f_business_52_0bg.png"}, &UploadFileImage{"/images/f_f_business_71_s512_f_business_71_0bg.png"}, &UploadFileImage{"/images/f_f_business_74_s512_f_business_74_0bg.png"}, &UploadFileImage{"/images/f_f_business_77_s512_f_business_77_0bg.png"}, &UploadFileImage{"/images/f_f_business_78_s512_f_business_78_0bg.png"}, &UploadFileImage{"/images/f_f_business_80_s512_f_business_80_0bg.png"}, &UploadFileImage{"/images/f_f_business_83_s512_f_business_83_0bg.png"}, &UploadFileImage{"/images/f_f_business_90_s512_f_business_90_0bg.png"}, &UploadFileImage{"/images/f_f_business_92_s512_f_business_92_0bg.png"}, &UploadFileImage{"/images/f_f_business_93_s512_f_business_93_0bg.png"}, &UploadFileImage{"/images/f_f_business_97_s512_f_business_97_0bg.png"}, &UploadFileImage{"/images/f_f_event_101_s512_f_event_101_0bg.png"}, &UploadFileImage{"/images/f_f_event_10_s512_f_event_10_0bg.png"}, &UploadFileImage{"/images/f_f_event_12_s512_f_event_12_0bg.png"}, &UploadFileImage{"/images/f_f_event_16_s512_f_event_16_0bg.png"}, &UploadFileImage{"/images/f_f_event_17_s512_f_event_17_0bg.png"}, &UploadFileImage{"/images/f_f_event_23_s512_f_event_23_0bg.png"}, &UploadFileImage{"/images/f_f_event_25_s512_f_event_25_0bg.png"}, &UploadFileImage{"/images/f_f_event_26_s512_f_event_26_0bg.png"}, &UploadFileImage{"/images/f_f_event_33_s512_f_event_33_0bg.png"}, &UploadFileImage{"/images/f_f_event_35_s512_f_event_35_0bg.png"}, &UploadFileImage{"/images/f_f_event_36_s512_f_event_36_0bg.png"}, &UploadFileImage{"/images/f_f_event_39_s512_f_event_39_0bg.png"}, &UploadFileImage{"/images/f_f_event_43_s512_f_event_43_0bg.png"}, &UploadFileImage{"/images/f_f_event_44_s512_f_event_44_0bg.png"}, &UploadFileImage{"/images/f_f_event_53_s512_f_event_53_0bg.png"}, &UploadFileImage{"/images/f_f_event_54_s512_f_event_54_0bg.png"}, &UploadFileImage{"/images/f_f_event_58_s512_f_event_58_0bg.png"}, &UploadFileImage{"/images/f_f_event_5_s512_f_event_5_0bg.png"}, &UploadFileImage{"/images/f_f_event_63_s512_f_event_63_0bg.png"}, &UploadFileImage{"/images/f_f_event_67_s512_f_event_67_0bg.png"}, &UploadFileImage{"/images/f_f_event_78_s512_f_event_78_0bg.png"}, &UploadFileImage{"/images/f_f_event_82_s512_f_event_82_0bg.png"}, &UploadFileImage{"/images/f_f_event_86_s512_f_event_86_0bg.png"}, &UploadFileImage{"/images/f_f_event_8_s512_f_event_8_0bg.png"}, &UploadFileImage{"/images/f_f_event_91_s512_f_event_91_0bg.png"}, &UploadFileImage{"/images/f_f_event_92_s512_f_event_92_0bg.png"}, &UploadFileImage{"/images/f_f_event_99_s512_f_event_99_0bg.png"}, &UploadFileImage{"/images/f_f_object_106_s512_f_object_106_0bg.png"}, &UploadFileImage{"/images/f_f_object_10_s512_f_object_10_0bg.png"}, &UploadFileImage{"/images/f_f_object_111_s512_f_object_111_0bg.png"}, &UploadFileImage{"/images/f_f_object_115_s512_f_object_115_0bg.png"}, &UploadFileImage{"/images/f_f_object_145_s512_f_object_145_0bg.png"}, &UploadFileImage{"/images/f_f_object_14_s512_f_object_14_0bg.png"}, &UploadFileImage{"/images/f_f_object_156_s512_f_object_156_0bg.png"}, &UploadFileImage{"/images/f_f_object_167_s512_f_object_167_0bg.png"}, &UploadFileImage{"/images/f_f_object_26_s512_f_object_26_0bg.png"}, &UploadFileImage{"/images/f_f_object_41_s512_f_object_41_0bg.png"}, &UploadFileImage{"/images/hayashi.png"}, &UploadFileImage{"/images/inoue.png"}, &UploadFileImage{"/images/ito.png"}, &UploadFileImage{"/images/kato.png"}, &UploadFileImage{"/images/kimura.png"}, &UploadFileImage{"/images/kobayashi.png"}, &UploadFileImage{"/images/matsumoto.png"}, &UploadFileImage{"/images/nakamura.png"}, &UploadFileImage{"/images/saito.png"}, &UploadFileImage{"/images/sasaki.png"}, &UploadFileImage{"/images/sato.png"}, &UploadFileImage{"/images/shimizu.png"}, &UploadFileImage{"/images/suzuki.png"}, &UploadFileImage{"/images/takahashi.png"}, &UploadFileImage{"/images/tanaka.png"}, &UploadFileImage{"/images/watanabe.png"}, &UploadFileImage{"/images/yamada.png"}, &UploadFileImage{"/images/yamaguchi.png"}, &UploadFileImage{"/images/yamamoto.png"}, &UploadFileImage{"/images/yoshida.png"}, &UploadFileImage{"/images/test.png"}, } )
Functions ¶
func CheckLayoutPreTest ¶
ログインユーザが投稿した記事、コメントは編集・削除ボタンが表示される ログインユーザ以外の記事、コメントに対しては編集・削除ボタンが表示されない
func CheckLogin ¶
- 存在するユーザでログインすることを確認 - ログアウトできることを確認 - 存在しないユーザではログインできないことを確認
func CheckValidation ¶
バリデーションの初期状態が守られているか
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 PrepareDataSet ¶
func PrepareDataSet()
func RandomAlphabetString ¶
func SetTargetHosts ¶
func SetTargetHosts(target []string)
Types ¶
type BenchDataSet ¶
type BenchDataSet struct {
Users []*AppUser
}
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" SetCookie string 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) PlayReturnRedirect ¶
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 State ¶
type State struct {
// contains filtered or unexported fields
}
func (*State) GetChecker ¶
func (*State) PopRandomUser ¶
type StaticFile ¶
type StaticFile struct {
Path string
}
type StaticFileImage ¶
type StaticFileImage struct {
Path string
}
type UploadFileImage ¶
type UploadFileImage struct {
Path string
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.