-
Notifications
You must be signed in to change notification settings - Fork 356
Event publishing for LoadBalancer
#218
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
Conversation
__Problem__ No events are published for `LoadBalancer` __Modification__ Publishing events for `LoadBalancer` __Result__ More events, more insight!
lastRefresh = now; | ||
addSockets(1); | ||
if (eventListener != null) { | ||
eventListener.socketsRefreshCompleted(Clock.elapsedSince(now), Clock.unit()); |
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.
I think this would be better moved inside addSocket
, since the addSocket
action is asynchronous.
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.
(Discussed offline)
It is more involved to emit this event after the addSocket
is finished. This event is more useful to indicate that socket refresh is happening, latency of connect can be useful in determining latency of refresh.
@@ -204,17 +223,17 @@ public LoadBalancer(Publisher<? extends Collection<ReactiveSocketClient>> factor | |||
|
|||
private synchronized void addSockets(int numberOfNewSocket) { | |||
int n = numberOfNewSocket; | |||
if (n > activeFactories.size()) { | |||
n = activeFactories.size(); | |||
if (n > activeFactories.holder.size()) { |
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.
Why not adding a size
method in ActiveList?
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.
Done.
@sgury I have addressed your comments. |
* Event publishing for `LoadBalancer` __Problem__ No events are published for `LoadBalancer` __Modification__ Publishing events for `LoadBalancer` __Result__ More events, more insight!
Replacing the dangling reference to LEASE_ERROR and replacing with REJECTED
Problem
No events are published for
LoadBalancer
Modification
Publishing events for
LoadBalancer
Result
More events, more insight!