Package io.grpc.util
Class OutlierDetectionLoadBalancer.EndpointTracker
java.lang.Object
io.grpc.util.OutlierDetectionLoadBalancer.EndpointTracker
- Enclosing class:
OutlierDetectionLoadBalancer
Tracks additional information about the endpoint needed for outlier detection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Tracks both successful and failed call counts. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private Long
private final Set
<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel> -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescription(package private) long
(package private) boolean
Adds a subchannel to the tracker, while assuring that the subchannel ejection status is updated to match the tracker's if needed.(package private) boolean
(package private) void
(package private) void
ejectSubchannels
(long ejectionTimeNanos) (package private) double
(package private) Set
<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel> (package private) long
(package private) void
incrementCallCount
(boolean success) boolean
maxEjectionTimeElapsed
(long currentTimeNanos) (package private) boolean
(package private) void
(package private) void
(package private) void
(package private) boolean
(package private) double
(package private) void
Swaps the active and inactive counters.toString()
(package private) void
Uneject a currently ejected address.
-
Field Details
-
config
-
activeCallCounter
-
inactiveCallCounter
-
ejectionTimeNanos
-
ejectionTimeMultiplier
private int ejectionTimeMultiplier -
subchannels
-
-
Constructor Details
-
EndpointTracker
EndpointTracker(OutlierDetectionLoadBalancer.OutlierDetectionLoadBalancerConfig config)
-
-
Method Details
-
setConfig
-
addSubchannel
Adds a subchannel to the tracker, while assuring that the subchannel ejection status is updated to match the tracker's if needed. -
removeSubchannel
-
containsSubchannel
-
getSubchannels
Set<OutlierDetectionLoadBalancer.OutlierDetectionSubchannel> getSubchannels() -
incrementCallCount
void incrementCallCount(boolean success) -
activeVolume
long activeVolume() -
inactiveVolume
long inactiveVolume() -
successRate
double successRate() -
failureRate
double failureRate() -
resetCallCounters
void resetCallCounters() -
decrementEjectionTimeMultiplier
void decrementEjectionTimeMultiplier() -
resetEjectionTimeMultiplier
void resetEjectionTimeMultiplier() -
swapCounters
void swapCounters()Swaps the active and inactive counters.Note that this method is not thread safe as the swap is not done atomically. This is expected to only be called from the timer that is scheduled at a fixed delay, assuring that only one timer is active at a time.
-
ejectSubchannels
void ejectSubchannels(long ejectionTimeNanos) -
unejectSubchannels
void unejectSubchannels()Uneject a currently ejected address. -
subchannelsEjected
boolean subchannelsEjected() -
maxEjectionTimeElapsed
public boolean maxEjectionTimeElapsed(long currentTimeNanos) -
toString
-