public AdvancedCircuitController(double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action <Exception, TimeSpan, Context> onBreak, Action <Context> onReset, Action onHalfOpen) : base(durationOfBreak, onBreak, onReset, onHalfOpen) { _metrics = samplingDuration.Ticks < ResolutionOfCircuitTimer * NumberOfWindows ? (IHealthMetrics) new SingleHealthMetrics(samplingDuration) : (IHealthMetrics) new RollingHealthMetrics(samplingDuration, NumberOfWindows); _failureThreshold = failureThreshold; _minimumThroughput = minimumThroughput; }
public AdvancedCircuitController(double failureThreshold, TimeSpan samplingDuration, int minimumThroughput, TimeSpan durationOfBreak, Action<Exception, TimeSpan, Context> onBreak, Action<Context> onReset, Action onHalfOpen) : base(durationOfBreak, onBreak, onReset, onHalfOpen) { _metrics = samplingDuration.Ticks < ResolutionOfCircuitTimer * NumberOfWindows ? (IHealthMetrics)new SingleHealthMetrics(samplingDuration) : (IHealthMetrics)new RollingHealthMetrics(samplingDuration, NumberOfWindows); _failureThreshold = failureThreshold; _minimumThroughput = minimumThroughput; }