C# Class Hudl.Mjolnir.Breaker.FailurePercentageCircuitBreaker

Trips when the error percentage rises above a configured threshold percentage. This breaker is modeled after Hystrix's HystrixCircuitBreakerImpl. However, the metrics implementations that drive the breaker are fairly different.
Inheritance: ICircuitBreaker
Show file Open project: hudl/Mjolnir Class Usage Examples

Private Properties

Property Type Description
AllowSingleTest bool
CheckAndSetTripped bool
FailurePercentageCircuitBreaker System
FailurePercentageCircuitBreaker System
IsPastWaitDuration bool

Public Methods

Method Description
IsAllowing ( ) : bool

MarkSuccess ( long elapsedMillis ) : void

Indicates that a recently-completed operation was successful. If the breaker is tripped and MarkSuccess() is called, the breaker will be fixed. The operation's elapsed duration (in milliseconds) is used to ensure the operation being checked began before the breaker was initially tripped.

Private Methods

Method Description
AllowSingleTest ( ) : bool

CheckAndSetTripped ( ) : bool

Checks to see if the breaker should trip, and trips if it should.

FailurePercentageCircuitBreaker ( Hudl.Mjolnir.Key.GroupKey key, IClock clock, ICommandMetrics metrics, IStats stats, IMetricEvents metricEvents, FailurePercentageCircuitBreakerProperties properties, IConfigurableValue gaugeIntervalMillisOverride = null ) : System
FailurePercentageCircuitBreaker ( Hudl.Mjolnir.Key.GroupKey key, ICommandMetrics metrics, IStats stats, IMetricEvents metricEvents, FailurePercentageCircuitBreakerProperties properties ) : System
IsPastWaitDuration ( ) : bool

Method Details

IsAllowing() public method

public IsAllowing ( ) : bool
return bool

MarkSuccess() public method

Indicates that a recently-completed operation was successful. If the breaker is tripped and MarkSuccess() is called, the breaker will be fixed. The operation's elapsed duration (in milliseconds) is used to ensure the operation being checked began before the breaker was initially tripped.
public MarkSuccess ( long elapsedMillis ) : void
elapsedMillis long
return void