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

(feat) Adding Chaos Engineering #136

Merged
merged 3 commits into from
Aug 25, 2024
Merged

(feat) Adding Chaos Engineering #136

merged 3 commits into from
Aug 25, 2024

Conversation

lanegoolsby
Copy link

@lanegoolsby lanegoolsby commented Jul 16, 2024

This is a direct copy of #114, I just addressed the PR feedback. I have a need for this feature and that other PR stalled. :)

@lanegoolsby
Copy link
Author

Hey @natenho, mind taking a look at this PR please?

{
httpResponse.StatusCode = (int)HttpStatusCode.InternalServerError;

var bodyBytes = Encoding.UTF8.GetBytes($"Error {httpResponse.StatusCode}: {HttpStatusCode.ServiceUnavailable}");
Copy link
Owner

Choose a reason for hiding this comment

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

The status code in the string is ServiceUnavailable, I suppose you mean InternalServerError, right?


private static IServiceCollection AddChaosServices(this IServiceCollection services) =>
services
.AddSingleton<IChaosStrategy, ChaosStrategyBehavior>()
Copy link
Owner

Choose a reason for hiding this comment

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

Do we really need singletons here? I would make any dependency as transient by default if I dont need a singleton..it is much easier to deal with concurrent requests in transient objects if we need some context inside the behavior

Copy link
Owner

@natenho natenho left a comment

Choose a reason for hiding this comment

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

@lanegoolsby there you go! The code is very good, just some minor issues, we can merge it asap if you could please review the pr comments! :)

@natenho
Copy link
Owner

natenho commented Aug 25, 2024

@lanegoolsby I took the liberty of making the changes to avoid taking even more time to do the merge. Thank you for your contribution!

@natenho natenho merged commit 99f53f4 into natenho:master Aug 25, 2024
3 checks passed
@lanegoolsby lanegoolsby deleted the chaos branch August 26, 2024 14:21
@lanegoolsby
Copy link
Author

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants