mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 00:17:37 +08:00
feat: support websocket protocol
This commit is contained in:
@@ -25,6 +25,7 @@ type TConfig struct {
|
||||
Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
|
||||
ParametersSetting *TParamsConfig `json:"parameters_setting,omitempty" yaml:"parameters_setting,omitempty"`
|
||||
ThinkTimeSetting *ThinkTimeConfig `json:"think_time,omitempty" yaml:"think_time,omitempty"`
|
||||
WebSocketSetting *WebSocketConfig `json:"websocket,omitempty" yaml:"websocket,omitempty"`
|
||||
Export []string `json:"export,omitempty" yaml:"export,omitempty"`
|
||||
Weight int `json:"weight,omitempty" yaml:"weight,omitempty"`
|
||||
Path string `json:"path,omitempty" yaml:"path,omitempty"` // testcase file path
|
||||
@@ -78,6 +79,14 @@ func (c *TConfig) SetWeight(weight int) *TConfig {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *TConfig) SetWebSocket(times, interval, timeout, size int64) {
|
||||
c.WebSocketSetting = &WebSocketConfig{
|
||||
ReconnectionTimes: times,
|
||||
ReconnectionInterval: interval,
|
||||
MaxMessageSize: size,
|
||||
}
|
||||
}
|
||||
|
||||
type ThinkTimeConfig struct {
|
||||
Strategy thinkTimeStrategy `json:"strategy,omitempty" yaml:"strategy,omitempty"` // default、random、limit、multiply、ignore
|
||||
Setting interface{} `json:"setting,omitempty" yaml:"setting,omitempty"` // random(map): {"min_percentage": 0.5, "max_percentage": 1.5}; 10、multiply(float64): 1.5
|
||||
|
||||
Reference in New Issue
Block a user