Table of Contents

Class ChaosStrategyOptions

Namespace
Polly.Simmy
Assembly
Polly.Core.dll

The options associated with the ChaosStrategy.

public abstract class ChaosStrategyOptions : ResilienceStrategyOptions
Inheritance
ChaosStrategyOptions
Derived
Inherited Members

Properties

Enabled

Gets or sets a value indicating whether or not the chaos strategy is enabled for a given execution.

public bool Enabled { get; set; }

Property Value

bool

Defaults to true. When EnabledGenerator is specified, this property is ignored.

EnabledGenerator

Gets or sets the enable generator that indicates whether or not the chaos strategy is enabled for a given execution.

public Func<EnabledGeneratorArguments, ValueTask<bool>>? EnabledGenerator { get; set; }

Property Value

Func<EnabledGeneratorArguments, ValueTask<bool>>

Defaults to null. When the generator is specified, the Enabled property is ignored.

InjectionRate

Gets or sets the injection rate for a given execution, which the value should be between [0, 1] (inclusive).

[Range(0, 1)]
public double InjectionRate { get; set; }

Property Value

double

Defaults to 0.001, meaning one in a thousand executions/0.1%. When InjectionRateGenerator is specified, this property is ignored.

InjectionRateGenerator

Gets or sets the injection rate generator for a given execution, which the value should be between [0, 1] (inclusive).

public Func<InjectionRateGeneratorArguments, ValueTask<double>>? InjectionRateGenerator { get; set; }

Property Value

Func<InjectionRateGeneratorArguments, ValueTask<double>>

Defaults to null. When generator is specified, the InjectionRate property is ignored.

Randomizer

Gets or sets the Randomizer generator instance that is used to evaluate the injection rate.

[Required]
public Func<double> Randomizer { get; set; }

Property Value

Func<double>

The default randomizer is thread safe and returns values between 0.0 and 1.0.