Skip to content

Commit

Permalink
core: add additional logging to OutlierDetection FailurePercentage al…
Browse files Browse the repository at this point in the history
…gorithm
  • Loading branch information
s-matyukevich committed Feb 9, 2023
1 parent 15bac91 commit b360b89
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,9 @@ public void ejectOutliers(AddressTrackerMap trackerMap, long ejectionTimeNanos)
if (tracker.successRate() < requiredSuccessRate) {
logger.log(ChannelLogLevel.DEBUG,
"SuccessRate algorithm detected outlier: {0}. "
+ "Parameters: mean={1}, stdev={2}, requiredSuccessRate={3}",
tracker, mean, stdev, requiredSuccessRate);
+ "Parameters: successRate={1}, mean={2}, stdev={3}, "
+ "requiredSuccessRate={4}",
tracker, tracker.successRate(), mean, stdev, requiredSuccessRate);
// Only eject some addresses based on the enforcement percentage.
if (new Random().nextInt(100) < config.successRateEjection.enforcementPercentage) {
tracker.ejectSubchannels(ejectionTimeNanos);
Expand Down Expand Up @@ -855,7 +856,8 @@ public void ejectOutliers(AddressTrackerMap trackerMap, long ejectionTimeNanos)
double maxFailureRate = ((double)config.failurePercentageEjection.threshold) / 100;
if (tracker.failureRate() > maxFailureRate) {
logger.log(ChannelLogLevel.DEBUG,
"FailurePercentage algorithm detected outlier: {0}", tracker);
"FailurePercentage algorithm detected outlier: {0}, failureRate={1}",
tracker, tracker.failureRate());
// ...but only enforce this based on the enforcement percentage.
if (new Random().nextInt(100) < config.failurePercentageEjection.enforcementPercentage) {
tracker.ejectSubchannels(ejectionTimeNanos);
Expand Down

0 comments on commit b360b89

Please sign in to comment.