private bool ShouldSuppress(TransientErrorInfo.ErrorType intendedState) { if (this.m_suppressedCurrentState != TransientErrorInfo.ErrorType.Unknown) { intendedState = this.m_suppressedCurrentState; } TimeSpan t = this.m_successTransitionSuppression; TimeSpan timeSpan = this.m_successPeriodicInterval; if (intendedState == TransientErrorInfo.ErrorType.Failure) { t = this.m_failureTransitionSuppression; timeSpan = this.m_failurePeriodicInterval; } if (this.CurrentActualStateDuration >= t) { if (this.m_lastPeriodicStateReturnedUtc == null) { this.m_lastPeriodicStateReturnedUtc = new DateTime?(DateTime.UtcNow); return(false); } if (timeSpan == TransientErrorInfoPeriodic.InfiniteTimeSpan) { return(true); } TimeSpan t2 = DateTime.UtcNow.Subtract(this.m_lastPeriodicStateReturnedUtc.Value); if (t2 >= timeSpan) { this.m_lastPeriodicStateReturnedUtc = new DateTime?(DateTime.UtcNow); return(false); } } return(true); }
private bool SetCurrentSuppressedState(TransientErrorInfo.ErrorType newState) { if (newState != this.m_suppressedCurrentState) { this.m_suppressedCurrentState = newState; this.m_lastActualStateTransitionAfterSuppressionUtc = new DateTime?(DateTime.UtcNow); this.m_lastPeriodicStateReturnedUtc = null; return(true); } return(false); }
private void RaiseAppropriateEvent(TransientErrorInfo.ErrorType currentState, IHealthValidationResultMinimal result) { if (currentState == TransientErrorInfo.ErrorType.Success) { this.RaiseGreenEvent(result); return; } if (currentState == TransientErrorInfo.ErrorType.Failure) { this.RaiseRedEvent(result); } }
public bool ReportFailurePeriodic(out TransientErrorInfo.ErrorType currentState) { currentState = this.m_suppressedCurrentState; if (!this.m_internalSuppressionInfo.ReportFailure(this.m_failureTransitionSuppression)) { return(!this.ShouldSuppress(TransientErrorInfo.ErrorType.Failure)); } if (this.SetCurrentSuppressedState(TransientErrorInfo.ErrorType.Failure)) { currentState = this.m_suppressedCurrentState; this.m_lastPeriodicStateReturnedUtc = new DateTime?(DateTime.UtcNow); return(true); } return(!this.ShouldSuppress(TransientErrorInfo.ErrorType.Failure)); }
internal static ErrorTypePersisted ConvertErrorTypeToSerializable(TransientErrorInfo.ErrorType errorType) { switch (errorType) { case TransientErrorInfo.ErrorType.Unknown: return(ErrorTypePersisted.Unknown); case TransientErrorInfo.ErrorType.Success: return(ErrorTypePersisted.Success); case TransientErrorInfo.ErrorType.Failure: return(ErrorTypePersisted.Failure); default: DiagCore.RetailAssert(false, "Missing case for enumeration: {0}", new object[] { errorType }); return(ErrorTypePersisted.Unknown); } }
public TransientPeriodicDatabaseErrorSuppression(TimeSpan successTransitionSuppression, TimeSpan successPeriodicInterval, TimeSpan failureTransitionSuppression, TimeSpan failurePeriodicInterval, TransientErrorInfo.ErrorType initialState) : base(successTransitionSuppression, successPeriodicInterval, failureTransitionSuppression, failurePeriodicInterval, initialState) { }
public TransientErrorInfoPeriodic(TimeSpan successTransitionSuppression, TimeSpan successPeriodicInterval, TimeSpan failureTransitionSuppression, TimeSpan failurePeriodicInterval, TransientErrorInfo.ErrorType initialState) { this.m_successTransitionSuppression = successTransitionSuppression; this.m_successPeriodicInterval = successPeriodicInterval; this.m_failureTransitionSuppression = failureTransitionSuppression; this.m_failurePeriodicInterval = failurePeriodicInterval; this.m_internalSuppressionInfo = new TransientErrorInfo(); this.SetCurrentSuppressedState(initialState); }
// Token: 0x0600155A RID: 5466 RVA: 0x00055346 File Offset: 0x00053546 private void UpdateErrorState(TransientErrorInfo.ErrorType errorState) { this.m_lastErrorState = this.m_currentErrorState; this.m_currentErrorState = errorState; }
protected TransientPeriodicErrorSuppression(TimeSpan successTransitionSuppression, TimeSpan successPeriodicInterval, TimeSpan failureTransitionSuppression, TimeSpan failurePeriodicInterval, TransientErrorInfo.ErrorType initialState) { this.m_successTransitionSuppression = successTransitionSuppression; this.m_successPeriodicInterval = successPeriodicInterval; this.m_failureTransitionSuppression = failureTransitionSuppression; this.m_failurePeriodicInterval = failurePeriodicInterval; this.m_initialState = initialState; this.InitializeTable(); }
public bool ReportFailurePeriodic(TKey key, out TransientErrorInfo.ErrorType currentState) { TransientErrorInfoPeriodic existingOrNewErrorInfo = this.GetExistingOrNewErrorInfo(key); return(existingOrNewErrorInfo.ReportFailurePeriodic(out currentState)); }