Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResultCodePlain ¶
func GetResultCodePlain(code ResultCode) string
Types ¶
type CallResult ¶
type CallResult struct { Id int64 // ID。 Req RawReq // 原生请求。 Resp RawResp // 原生响应。 Code ResultCode // 响应代码。 Msg string // 结果成因的简述。 Elapse time.Duration // 耗时。 }
调用结果的结构。
type Caller ¶
type Caller interface { // 构建请求。 BuildReq() RawReq // 调用。 Call(req []byte, timeoutNs time.Duration) ([]byte, error) // 检查响应。 CheckResp(rawReq RawReq, rawResp RawResp) *CallResult }
调用器的接口。
type Generator ¶
type Generator interface { // 启动载荷发生器。 Start() // 停止载荷发生器。 // 第一个结果值代表已发载荷总数,且仅在第二个结果值为true时有效。 // 第二个结果值代表是否成功将载荷发生器转变为已停止状态。 Stop() (uint64, bool) // 获取状态。 Status() GenStatus }
载荷发生器的接口。
type GoTickets ¶
type GoTickets interface { // 拿走一张票。 Take() // 归还一张票。 Return() // 票池是否已被激活。 Active() bool // 票的总数。 Total() uint32 // 剩余的票数。 Remainder() uint32 }
Goroutine票池的接口。
func NewGoTickets ¶
type ResultCode ¶
type ResultCode int
const ( RESULT_CODE_SUCCESS = 0 // 成功。 RESULT_CODE_WARNING_CALL_TIMEOUT ResultCode = 1001 // 调用超时警告。 RESULT_CODE_ERROR_CALL ResultCode = 2001 // 调用错误。 RESULT_CODE_ERROR_RESPONSE ResultCode = 2002 // 响应内容错误。 RESULT_CODE_ERROR_CALEE ResultCode = 2003 // 被调用方(被测软件)的内部错误。 RESULT_CODE_FATAL_CALL ResultCode = 3001 // 调用过程中发生了致命错误! )
保留 1 ~ 1000 给载荷承受者使用。
Click to show internal directories.
Click to hide internal directories.