-
Notifications
You must be signed in to change notification settings - Fork 25
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
Conversation
Nice, @vany0114! Will do a full read in the next few days! |
There was a problem hiding this 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 | |||
|
There was a problem hiding this comment.
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>>); | ||
``` | ||
|
There was a problem hiding this comment.
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()
);
@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! 🎉 |
By the way, feel free to polish the documentation if I missed something. |
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.