Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New syntax documentation #58

Merged
merged 2 commits into from
Dec 27, 2019
Merged

Conversation

vany0114
Copy link
Member

Hi @reisenberger

I've updated the documentation according to the new syntax changes. BTW I'm very bad at wording, so feel free to change it if necessary.

@reisenberger
Copy link
Member

Nice, @vany0114! Will do a full read in the next few days!

Copy link
Member

@reisenberger reisenberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vany0114 This is great! Main thought: maybe we should give full syntax examples before / alongside each abstract definition

var chaosPolicy = MonkeyPolicy.InjectException(Action<InjectOutcomeOptions<Exception>>);

or

PolicyOptions.InjectionRate(Double);

What do you think? Maybe it's just merging the Step 1 examples section upwards into the Usage section, or starting with examples first

@@ -34,46 +34,118 @@ Simmy offers the following chaos-injection policies:

|Policy| What does the policy do?|
| ------------- |------------- |
|**[Fault](#Inject-fault)**|Injects exceptions or substitute results, to fake faults in your system.|
|**[Exception](#Inject-exception)**|Injects exceptions in your system.|
|**[Result](#Inject-result)**|Substitute results to fake faults in your system.|
|**[Latency](#Inject-latency)**|Injects latency into executions before the calls are made.|
|**[Behavior](#Inject-behavior)**|Allows you to inject _any_ extra behaviour, before a call is placed. |

# Usage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we give a full example here, before we give the syntax for the specific parts/cases? (the syntax for parts might make more sense after the reader has seen a full example)

// Following example causes the policy to throw SocketException with a probability of 5% if enabled
var fault = new SocketException(errorCode: 10013);
var chaosPolicy = MonkeyPolicy.InjectException(with =>
    with.Fault(fault)
        .InjectionRate(0.05)
        .Enabled()
    );

);
var chaosPolicy = MonkeyPolicy.InjectException(Action<InjectOutcomeOptions<Exception>>);
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should give an example here as well as the 'abstract' syntax? Maybe something like below:

((( Maybe we will end up moving all the examples from Basic examples Step 1 Set up the Monkey Policy. Maybe we could just merge that whole section into here - what do you think? )))

var chaosPolicy = MonkeyPolicy.InjectException(Action<InjectOutcomeOptions<Exception>>);

For example

var chaosPolicy = MonkeyPolicy.InjectException(with =>
    with.Fault(new SocketException(errorCode: 10013))
        .InjectionRate(0.05)
        .Enabled()
    );

@vany0114
Copy link
Member Author

@reisenberger I agree, I think it makes more sense in order for the user to understand the syntax/usage seeing the examples alongside each abstract definition. I merged the Basic examples Step 1 Set up the Monkey Policy section into the usage one as you suggested.

Thanks for the suggestions and Merry Christmas! 🎉

@vany0114
Copy link
Member Author

By the way, feel free to polish the documentation if I missed something.

@reisenberger reisenberger merged commit 4b0ce05 into v0_2_1 Dec 27, 2019
@vany0114 vany0114 deleted the vany0114-new-syntax-documentation branch January 4, 2020 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants