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

Determining the effectiveness of hedging #42

Closed
dannykopping opened this issue Aug 8, 2023 · 3 comments · Fixed by #46
Closed

Determining the effectiveness of hedging #42

dannykopping opened this issue Aug 8, 2023 · 3 comments · Fixed by #46
Labels
feature New feature or request

Comments

@dannykopping
Copy link
Contributor

Hey @cristaloleg

Is there a way to determine how many hedged requests actually "won" vs the original request, with the stats?

@cristaloleg
Copy link
Member

Hm, interesting question. The simplest answer is to look at the metrics & compare results for original vs hedged requests. Again as per #18 and custom http.RoundTripper witch collects those stats.

The only thing is that it will report global stats, not per every request (that's how I imagine it's behaviour). Adding no-op ?req_id=XXX to every request can help with request grouping and as a result true metric for each request.

I can try to make a PoC this week unless you're eager ;)

@dannykopping
Copy link
Contributor Author

OK cool, thanks!

I'll be back on this topic next week, and I might put together a PR unless you get to it first 🙂
It doesn't necessarily need to be per-request; I just want to be able answer the question "of all the hedged requests we made, what % of them actually helped?".

@cristaloleg
Copy link
Member

I did a quick prototype #46 (so no tests) but looks like that's what we want.

If we got a response/result from waitResult and it's successful (resp is not nil) than we can bump a metric for the original (index 0) or hedged (index non-zero).

I will try to cover this with a test tomorrow-ish. Review and thoughts are welcome.

CC: @storozhukBM

@cristaloleg cristaloleg added the feature New feature or request label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants