Skip to content

Commit eb1207b

Browse files
committed
docs: correct the wrong help description of --rate flag
1 parent 7954e57 commit eb1207b

File tree

4 files changed

+80
-80
lines changed

4 files changed

+80
-80
lines changed

client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type ClientConfig struct {
2727
Protocol string
2828
ConnectFlavor string
2929
Connections int32
30-
ConnectRate int32
30+
Rate int32
3131
Duration time.Duration
3232
MessageBytes int32
3333
MergeResultsEachHost bool
@@ -143,8 +143,8 @@ func (c *Client) connectPersistent(ctx context.Context, addrport string) error {
143143
}
144144
defer conn.Close()
145145

146-
msgsTotal := int64(c.config.ConnectRate) * int64(c.config.Duration.Seconds())
147-
limiter := ratelimit.New(int(c.config.ConnectRate))
146+
msgsTotal := int64(c.config.Rate) * int64(c.config.Duration.Seconds())
147+
limiter := ratelimit.New(int(c.config.Rate))
148148

149149
for j := int64(0); j < msgsTotal; j++ {
150150
if err := waitLim(ctx, limiter); err != nil {
@@ -195,8 +195,8 @@ func (c *Client) connectEphemeral(ctx context.Context, addrport string) error {
195195
Control: GetTCPControlWithFastOpen(),
196196
}
197197

198-
connTotal := int64(c.config.ConnectRate) * int64(c.config.Duration.Seconds())
199-
limiter := ratelimit.New(int(c.config.ConnectRate))
198+
connTotal := int64(c.config.Rate) * int64(c.config.Duration.Seconds())
199+
limiter := ratelimit.New(int(c.config.Rate))
200200

201201
eg, ctx := errgroup.WithContext(ctx)
202202
for i := int64(0); i < connTotal; i++ {
@@ -258,11 +258,11 @@ func (c *Client) connectUDP(ctx context.Context, addrport string) error {
258258
ctx, cancel := context.WithTimeout(ctx, c.config.Duration)
259259
defer cancel()
260260

261-
connTotal := int64(c.config.ConnectRate) * int64(c.config.Duration.Seconds())
262-
limiter := ratelimit.New(int(c.config.ConnectRate))
261+
connTotal := int64(c.config.Rate) * int64(c.config.Duration.Seconds())
262+
limiter := ratelimit.New(int(c.config.Rate))
263263

264264
bufUDPPool := sync.Pool{
265-
New: func() any {
265+
New: func() any {
266266
buf := make([]byte, c.config.MessageBytes)
267267
return &buf
268268
},

0 commit comments

Comments
 (0)