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

Proposal ~ Sliding Window based algorithm for state transitions of CB #64

Open
pg30 opened this issue Sep 17, 2024 · 5 comments
Open

Proposal ~ Sliding Window based algorithm for state transitions of CB #64

pg30 opened this issue Sep 17, 2024 · 5 comments

Comments

@pg30
Copy link

pg30 commented Sep 17, 2024

Hey @YoshiyukiMineo ,
I am new to golang and recently integrated this library in one of my prod services. After going through the code base, I noticed that it uses fixed windows for maintaining and clearing counts of success/failure requests which works fine for most of the use cases out there, but it has some drawbacks as already raised previously.
I am thinking of contributing the sliding window based algo where window can be either COUNT based or TIME based and we can configure the window size along with failure thresholds.

For implementation I am thinking a circular array of size N (window size) where each index will either represent a request (COUNT based) or a second (TIME based). In TIME based each index will also contain partial aggregates of success/failed request in that second along with a total aggregate of a window.

Lmk your thoughts on the approach.

@pg30
Copy link
Author

pg30 commented Oct 3, 2024

@YoshiyukiMineo lmk when you see this, I am not starting this implementation as you might be busy for discussing this and merging eventually and I don't want the effort to go to waste.

I am happy to pick this up when you are free.

@YoshiyukiMineo
Copy link
Member

@pg30
I think it is better to support only time-based window for compatibility.
I have created a draft specification:
https://github.com/sony/gobreaker/wiki/Draft-Specification-for-Time%E2%80%90Based-Rolling-Window

@pg30
Copy link
Author

pg30 commented Oct 13, 2024

Cool, Will check it out and pick it up sometime over next weekend.

@brijsiyag-meesho
Copy link

Hey @pg30, Are you working on this?

@pg30
Copy link
Author

pg30 commented Nov 5, 2024

Hey @brijsiyag-meesho
I have been super busy in other work. Feel free to pick this up or else i will pick it up in a couple of weeks.

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

No branches or pull requests

3 participants