File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -158,21 +158,23 @@ func runTestWriter(ctx context.Context) error {
158
158
return errors .New ("Stopping because of user response" )
159
159
}
160
160
161
+ batchSize := 5
162
+
161
163
writer := kafka .NewWriter (
162
164
kafka.WriterConfig {
163
165
Brokers : []string {connector .Config .BrokerAddr },
164
166
Dialer : connector .Dialer ,
165
167
Topic : testerConfig .topic ,
166
168
Balancer : & kafka.LeastBytes {},
167
169
Async : false ,
168
- BatchSize : 5 ,
170
+ BatchSize : batchSize ,
169
171
BatchTimeout : 1 * time .Millisecond ,
170
172
},
171
173
)
172
174
defer writer .Close ()
173
175
174
176
index := 0
175
- tickDuration := time .Duration (1000.0 / float64 (testerConfig .writeRate )) * time .Millisecond
177
+ tickDuration := time .Duration (1000.0 / float64 (testerConfig .writeRate / batchSize )) * time .Millisecond
176
178
sendTicker := time .NewTicker (tickDuration )
177
179
logTicker := time .NewTicker (5 * time .Second )
178
180
You can’t perform that action at this time.
0 commit comments