-
Notifications
You must be signed in to change notification settings - Fork 14.5k
KAFKA-19011: Improve EndToEndLatency Tool with argument parser and message key/header support #20301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
…ssage key/header support
The updated usage of the tool with argument parser:
It's compatible with the legacy version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Partial review, some comments left. Also, could you add the KIP to the title or description?
tools/src/main/java/org/apache/kafka/tools/EndToEndLatency.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/EndToEndLatency.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/EndToEndLatency.java
Outdated
Show resolved
Hide resolved
tools/src/main/java/org/apache/kafka/tools/EndToEndLatency.java
Outdated
Show resolved
Hide resolved
|
||
// validate 'producer-acks' | ||
String acksValue = options.valueOf(acksOpt); | ||
if (!List.of("1", "all").contains(acksValue)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if -1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The legacy version only had these two options, so I keep it the same. Since -1
has the same effect as all
, I think one is enough?
@@ -221,4 +303,156 @@ private static KafkaProducer<byte[], byte[]> createKafkaProducer(Optional<String | |||
producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer"); | |||
return new KafkaProducer<>(producerProps); | |||
} | |||
|
|||
// Visible for testing | |||
static String[] convertLegacyArgsIfNeeded(String[] args) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add Deprecated tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing that out! Added it.
@Rancho-7 could you please run e2e on you local? |
jira: https://issues.apache.org/jira/browse/KAFKA-19011 kip:
https://cwiki.apache.org/confluence/display/KAFKA/KIP-1172%3A+Improve+EndToEndLatency+tool
This PR improves the usability and maintainability of the
kafka-e2e-latency.sh
tool:(joptsimple)