kube-monkey icon indicating copy to clipboard operation
kube-monkey copied to clipboard

Extend mtbf time range to also support hours and minutes.

Open snarlistic opened this issue 11 months ago • 4 comments

This PR changes the definition of "kube-monkey/mtbf".

Alike https://github.com/misgod-yy in https://github.com/asobti/kube-monkey/pull/168 we needed a more fine grained control for the mean time between failure. A couple of years ago a coworker of mine took the misgod-yy patches and updated a now very old version of your software, fixed the problems with that code and we have been using this happily ever since for several years now.

The downside of this approach was that we were still using this very old version of the software and recently decided that's not okay anymore. Hence I ported our patches to the newest version of your code and improved it a tiny bit. Please bare with me, this is the first Golang programming I did.

Please review my work. I think it solves all the issues you had with the more early work of https://github.com/misgod-yy. It for instance sticks to minutes, hours and days, it removed the weird naming and last but not least is no breaking change as one can specify days as a simply integer (old style) and as an integer with an additional d-unit (new-style).

I hope you like it.

snarlistic avatar Mar 22 '24 15:03 snarlistic

Please forgive me for the confusion, but it bothered me a bit that I had complicated matters a bit. I misunderstood certain aspects of the RandomTimeInRange code my coworker wrote at first and so I did not fully understand it already implements the ShouldScheduleChaos functionality. Hence I wrote some complicated code that in the end was not needed. This I realized today and for that reason I updated this pull request with the extra commit: 03a90f0272d42457ce297d641726347023a8d59d. Hope you now even like it better. :)

snarlistic avatar Mar 23 '24 18:03 snarlistic

Thanks for the contribution @snarlistic! I'll take a closer look in the next few days :)

worldtiki avatar Mar 24 '24 19:03 worldtiki

@worldtiki any news?

lexfrei avatar Apr 17 '24 12:04 lexfrei

With a bit of shame I have to admit the code contained some issues and ugliness. My last commit solved both and I have this version running for some time now. Hopefully it is useful and you are open to accept my work.

snarlistic avatar Jun 16 '24 19:06 snarlistic