-
Notifications
You must be signed in to change notification settings - Fork 181
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
Latency tracking utilities to support LB L7 breakers #2794
Conversation
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.
Other than the one grammar error I don't mind waiting to address any more feedback in follow ups since none of this is being exposed yet.
servicetalk-loadbalancer/src/main/java/io/servicetalk/loadbalancer/DefaultLatencyTracker.java
Outdated
Show resolved
Hide resolved
servicetalk-loadbalancer/src/main/java/io/servicetalk/loadbalancer/DefaultLatencyTracker.java
Outdated
Show resolved
Hide resolved
if (halfLifeNanos <= 0) { | ||
throw new IllegalArgumentException("halfLifeNanos: " + halfLifeNanos + " (expected >0)"); | ||
} | ||
tau = halfLifeNanos / log(2); |
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.
ffti: probably not worth the noise but if you store inv_tau
we can use multiplcation later on instead of the slower division.
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.
Is Math.pow((halfLifeNanos / log(2)), -1)
what you had in mind?
servicetalk-loadbalancer/src/main/java/io/servicetalk/loadbalancer/DefaultLatencyTracker.java
Outdated
Show resolved
Hide resolved
servicetalk-loadbalancer/src/main/java/io/servicetalk/loadbalancer/DefaultLatencyTracker.java
Outdated
Show resolved
Hide resolved
servicetalk-loadbalancer/src/main/java/io/servicetalk/loadbalancer/LatencyTracker.java
Outdated
Show resolved
Hide resolved
…ncer/DefaultLatencyTracker.java Co-authored-by: Bryce Anderson <bryce_anderson@apple.com>
…ncer/LatencyTracker.java Co-authored-by: Bryce Anderson <bryce_anderson@apple.com>
Motivation
Support latency tracking APIs and default EWMA based decay-able solutions to allow implementation of richer L7 circuit breakers for the load balancers.
Modification
Introduced the LatencyTracker API along with a default implementation.