Class ChaosOptions

Namespace
Kuestenlogik.Bowire.Mock.Chaos
Assembly
Kuestenlogik.Bowire.Mock.dll

Chaos-injection tunables (Phase 3a). Applied by the mock middleware before it dispatches to the replayer, so every matched request gets the same treatment regardless of protocol or method type.

public sealed class ChaosOptions
Inheritance
ChaosOptions
Inherited Members

Remarks

Defaults mean "off": FailRate is 0, latency bounds are null. Populated either programmatically (embedded mode) or from --chaos "latency:100-500,fail-rate:0.05" (CLI mode) via Parse(string).

Constructors

ChaosOptions()

public ChaosOptions()

Properties

FailRate

Probability of failing a request before it reaches the replayer. 0 = never (default), 1 = always.

public double FailRate { get; set; }

Property Value

double

FailStatusCode

HTTP status code returned when a fail-rate hit fires. Defaults to 503 Service Unavailable.

public int FailStatusCode { get; set; }

Property Value

int

IsActive

True when any chaos dimension is turned on.

public bool IsActive { get; }

Property Value

bool

LatencyMaxMs

Upper bound of the injected delay, in milliseconds. Must be >= LatencyMinMs when both are set.

public int? LatencyMaxMs { get; set; }

Property Value

int?

LatencyMinMs

Lower bound of the injected delay, in milliseconds. null disables latency jitter.

public int? LatencyMinMs { get; set; }

Property Value

int?

Methods

Parse(string)

Parse a --chaos CLI argument. Accepts a comma-separated list of key:value pairs. Recognised keys:

  • latency — either a single number (fixed delay in ms) or a min-max range.
  • fail-rate — a probability between 0 and 1 (e.g. 0.05 for 5%).
  • fail-status — override the HTTP status for fail-rate hits (default 503).

Throws FormatException on unrecognised keys or malformed values so CLI users see the problem early.

public static ChaosOptions Parse(string spec)

Parameters

spec string

Returns

ChaosOptions