29 lines
802 B
Go
29 lines
802 B
Go
package storage
|
|
|
|
//默认配置
|
|
func newDefaultConfig() *Config {
|
|
return &Config{
|
|
Pressure: PressureConfig{
|
|
TimeoutMs: 50,
|
|
Concurrency: 10,
|
|
DurationS: 5,
|
|
},
|
|
UserCount: 100,
|
|
}
|
|
}
|
|
|
|
type Config struct {
|
|
Pressure PressureConfig `json:"Pressure,omitempty"`
|
|
UserCount int32 `json:"UserCount,omitempty"` //用户数
|
|
SId string `json:"sid,omitempty"` //区服ID
|
|
WsAddr string `json:"wsAddr,omitempty"` //websocket addr
|
|
IntervalS int32 `json:"intervalS,omitempty"` //间隔时间s
|
|
}
|
|
|
|
//压测配置
|
|
type PressureConfig struct {
|
|
TimeoutMs int32 `json:"timeout,omitempty"` //超时时间 毫秒
|
|
Concurrency int32 `json:"concurrency,omitempty"` //并发量
|
|
DurationS int32 `json:"duration,omitempty"` //持续时间 秒
|
|
}
|