feat(go): add load simulator hold mode
This commit is contained in:
@@ -24,6 +24,7 @@ type Config struct {
|
||||
SendInterval time.Duration
|
||||
Duration time.Duration
|
||||
Template string
|
||||
SendFrames bool
|
||||
}
|
||||
|
||||
type FlagConfig struct {
|
||||
@@ -34,6 +35,7 @@ type FlagConfig struct {
|
||||
sendInterval time.Duration
|
||||
duration time.Duration
|
||||
template string
|
||||
sendFrames bool
|
||||
}
|
||||
|
||||
func RegisterFlags(fs *flag.FlagSet) *FlagConfig {
|
||||
@@ -45,6 +47,7 @@ func RegisterFlags(fs *flag.FlagSet) *FlagConfig {
|
||||
fs.DurationVar(&cfg.sendInterval, "send-interval", 10*time.Second, "frame send interval per connection")
|
||||
fs.DurationVar(&cfg.duration, "duration", 10*time.Minute, "load test duration")
|
||||
fs.StringVar(&cfg.template, "template", "", "frame template name")
|
||||
fs.BoolVar(&cfg.sendFrames, "send", true, "send protocol frames while connections are open")
|
||||
return cfg
|
||||
}
|
||||
|
||||
@@ -78,5 +81,6 @@ func (c *FlagConfig) Build() (Config, error) {
|
||||
SendInterval: c.sendInterval,
|
||||
Duration: c.duration,
|
||||
Template: strings.TrimSpace(c.template),
|
||||
SendFrames: c.sendFrames,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user