matt-welch commented on code in PR #17340:
URL: https://github.com/apache/kafka/pull/17340#discussion_r1887678743


##########
tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java:
##########
@@ -94,7 +98,18 @@ void start(String[] args) throws IOException {
                 record = new ProducerRecord<>(config.topicName, payload);
 
                 long sendStartMs = System.currentTimeMillis();
-                cb = new PerfCallback(sendStartMs, payload.length, stats);
+                if (config.warmupRecords > 0) {
+                    if (i < config.warmupRecords) {
+                        cb = new PerfCallback(sendStartMs, payload.length, 
stats);
+                    } else {
+                        if (i == config.warmupRecords) {
+                            steadyStateStats = new Stats(config.numRecords - 
config.warmupRecords, DEFAULT_REPORTING_INTERVAL_MS, config.warmupRecords > 0);

Review Comment:
   Apologies if I'm still misunderstanding your query, but the conditional 
"config.warmupRecords > 0" will only evaluate to true when the argument 
'--warmup-records N' is invoked on the command line and N is greater than zero. 
The value for config.warmupRecords defaults to '0' otherwise. The if-clause on 
that line is the path used when a warmup is invoked. The else-clause will be 
used when no warmup has been requested. This else clause represents the same 
code path used in previous versions of the test with no warmup.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to