...
This means we cannot effectively compare these two benchmark results as the latency in #2 is anywhere from 0 to 100% higher than in #1, which is a big spread and results in very different implications.
Public Interfaces
Briefly list any new interfaces that will be introduced as part of this proposal or any existing interfaces that will be removed or changed. The purpose of this section is to concisely call out the public contract that will come along with this feature.
A public interface is any change to the following:
Binary log format
The network protocol and api behavior
Any class in the public packages under clientsConfiguration, especially client configuration
org/apache/kafka/common/serialization
org/apache/kafka/common
org/apache/kafka/common/errors
org/apache/kafka/clients/producer
org/apache/kafka/clients/consumer (eventually, once stable)
Monitoring
Command line tools and arguments
- Anything else that will likely break existing users in some way when they upgrade
Proposed Changes
...
To achieve a higher precision to handle low-latency environments better, we can use Java’s System.nanoTime().
Public Interfaces
Proposed Changes
This KIP proposes using nanoTime() to record latencies to provide higher precision.
Latency will be recorded in microseconds by truncating the result of calling nanoTime() by 3 digits.
Code Block | ||
---|---|---|
| ||
long startTimeUs = System.nanoTime() / 1000; // value in microseconds
// Send message…
// Message sent and callback called…
long latency = System.nanoTime() / 1000 - startTimeUs; // value in microseconds |
The code change required in this KIP is rather small, but this small change has a few considerations to discuss and address.
Considerations
Consideration #1: How Much Precision?
Compatibility, Deprecation, and Migration Plan
...