Skip to content

Commit

Permalink
Update chaos strategy documentation with notes
Browse files Browse the repository at this point in the history
  • Loading branch information
caigen authored Feb 7, 2025
1 parent e5ac3f8 commit 245ca26
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/chaos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ builder
.AddChaosBehavior(behaviorInjectionRate, cancellationToken => RestartRedisAsync(cancellationToken)); // Inject a chaos behavior to executions
```
<!-- endSnippet -->
> [!NOTE]
> It is usual to place the chaos strategy as the last strategy in the resilience pipeline.
> By placing the chaos strategies as last, they subvert the usual outbound call at the last minute, substituting their fault or adding extra latency, etc.
> The existing resilience strategies - further out in the `ResiliencePipeline` - still apply, so you can test how the Polly resilience strategies you have configured handle the chaos/faults injected by Simmy.
- It is usual to place the chaos strategy as the last strategy in the resilience pipeline.
- By placing the chaos strategies as last, they subvert the usual outbound call at the last minute, substituting their fault or adding extra latency, etc.
- The existing resilience strategies - further out in the `ResiliencePipeline` - still apply, so you can test how the Polly resilience strategies you have configured handle the chaos/faults injected by Simmy.

- The `AddChaos*` will take effect sequentially if you combine them together.
- In the above example, we use **fault first then latency strategy**, it can save fault waiting time. If you put `AddChaosLatency` before `AddChaosFault`, you will get different behavior.
> [!NOTE]
> The `AddChaosFault` `AddChaosLatency` `AddChaosOutcome` `AddChaosBehavior` will take effect sequentially if you combine them together.
> In the above example, we use **fault first then latency strategy**, it can save fault waiting time. If you put `AddChaosLatency` before `AddChaosFault`, you will get different behavior.
```mermaid
sequenceDiagram
Expand Down

0 comments on commit 245ca26

Please sign in to comment.