-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add playback success rate to /api/v1/stats
#4085
Conversation
Not even sure if we have a better solution than that? @SamantazFox thoughts? I think this PR is critical if we want to show to our users which instance works correctly or not. |
Very strange on my instance the stats are not getting updated, it stay at:
|
Huh that is weird. I can't replicate this on my end. The problem is probably something with the |
Oops I think I had an issue when testing the PR, it wasn't sending the requests to local /videoplayback endpoint. Now it works: "playback":{"totalRequests":3,"successfulRequests":0,"ratio":0.0} But the stats do not stay for very long. Like after 10 seconds they are gone. But I think on a public instance it's ok as they are constantly people sending requests to the /videoplayback endpoint. |
That can be mitigated if we bump the default stats refresh interval from one minute to something higher |
Could you do this change in this PR? Set it to more than 1 minute. |
I've bumped it to ten minutes |
I have merged this PR because I consider it working. And we can always improve the PR later. Also, this is really useful for the project https://github.com/iv-org/smart-ipv6-rotator |
Now that I think of it. Wouldn't have been better to have a percentage instead of a ratio? Percentage is much more appealing than a "ratio". |
#4083 (comment)
This PR tracks the total amount of
/videoplayback
requests and the ones that are successful in order to create a playback success rate in the/api/v1/stats
endpoint.By default it is an empty object:
"playback" : {}
But as soon as a video is played:
The caveat however is that with the way I have it currently set up the playback object gets reset back to an empty object each time the stats is refreshed. This is to prevent a success rate so high that 403 requests won't be able to budge the ratio at all. A better solution is probably needed there.
Closes #3957