chia7712 commented on code in PR #17340:
URL: https://github.com/apache/kafka/pull/17340#discussion_r1884803830
##########
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 for the unclear comment. Please see the following code.
```
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);
}
cb = new PerfCallback(sendStartMs, payload.length,
stats, steadyStateStats);
}
}
```
In this case, config.warmupRecords > 0 is always true.
--
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]