mirror of https://github.com/apache/kafka.git
MINOR: ProducerPerformance should work with older client jars
Author: Jun Rao <junrao@gmail.com> Reviewers: Ismael Juma <ismael@juma.me.uk> Closes #2896 from junrao/minor
This commit is contained in:
parent
1fbb8cfafa
commit
b154221774
|
|
@ -129,17 +129,24 @@ public class ProducerPerformance {
|
|||
}
|
||||
}
|
||||
|
||||
// Make sure all messages are sent before printing out the stats and the metrics
|
||||
producer.flush();
|
||||
if (!shouldPrintMetrics) {
|
||||
producer.close();
|
||||
|
||||
/* print final results */
|
||||
stats.printTotal();
|
||||
/* print final results */
|
||||
stats.printTotal();
|
||||
} else {
|
||||
// Make sure all messages are sent before printing out the stats and the metrics
|
||||
// We need to do this in a different branch for now since tests/kafkatest/sanity_checks/test_performance_services.py
|
||||
// expects this class to work with older versions of the client jar that don't support flush().
|
||||
producer.flush();
|
||||
|
||||
/* print out metrics */
|
||||
if (shouldPrintMetrics) {
|
||||
/* print final results */
|
||||
stats.printTotal();
|
||||
|
||||
/* print out metrics */
|
||||
ToolsUtils.printMetrics(producer.metrics());
|
||||
producer.close();
|
||||
}
|
||||
producer.close();
|
||||
} catch (ArgumentParserException e) {
|
||||
if (args.length == 0) {
|
||||
parser.printHelp();
|
||||
|
|
|
|||
Loading…
Reference in New Issue