private void EvaluateState() { if (_failed == 0 && _succeed == 0) { MonitorState = ProbeMonitorState.Init; } else if (_succeed >= _aliveThreshold) { MonitorState = ProbeMonitorState.Stable; } else if (_failed >= _probeFailureTolerance && _succeed == 0) { MonitorState = ProbeMonitorState.Failed; } else { MonitorState = ProbeMonitorState.Unstable; } _logger.LogTrace($"ProbeMonitorState: {MonitorState}"); _logger.LogTrace($"Internal failed counter: {_failed}, succeed counter: {_succeed}"); }
public ProbeMonitortStateChangedEventArgs(ProbeMonitorState oldState, ProbeMonitorState newState, Dictionary <string, string> attributes = null) { OldState = oldState; NewState = newState; Attributes = attributes; }