public void ProbingCompleted(ClusterInfo cluster, IReadOnlyList <DestinationProbingResult> probingResults) { cluster.PauseHealthyDestinationUpdates(); try { var threshold = GetFailureThreshold(cluster); for (var i = 0; i < probingResults.Count; i++) { var destination = probingResults[i].Destination; var count = _failureCounters.GetOrCreateValue(destination); var newHealth = EvaluateHealthState(threshold, probingResults[i].Response, count); var state = destination.DynamicState; if (newHealth != state.Health.Active) { destination.DynamicState = new DestinationDynamicState(state.Health.ChangeActive(newHealth)); if (newHealth == DestinationHealth.Unhealthy) { Log.ActiveDestinationHealthStateIsSetToUnhealthy(_logger, destination.DestinationId, cluster.ClusterId); } else { Log.ActiveDestinationHealthStateIsSet(_logger, destination.DestinationId, cluster.ClusterId, newHealth); } } } } finally { cluster.ResumeHealthyDestinationUpdates(); } }