-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Interface for request tracing #3533
Comments
Would request filters and response filters work for your use case? They aren't registered globally. They are mentioned in a few of the tutorials, such as for example the license wrapping tutorial. |
@theodab - Thanks for the information. I tried the request/response filters approach as you suggested. I think it should work (since the filters can be registered for a specific player instance) to an extent while there were some shortcomings I observed. In particular:
|
Ah, I see what you mean. The time that headers become available is something we could be measuring, but we don't at the moment. And we don't really inform the user of a failed download, directly; they only know if a failed download leads to the entire player erroring, but they won't hear if a failed download leads to a retry or similar. I'll mark this as an enhancement request, then. To me, adding new player events sounds like the best solution. How would this set of events look to you?
|
The player events sound reasonable. I like to add a few comments:
|
This adds two new player events, 'downloadheadersreceived' and 'downloadfailed', to allow users to measure network performance in greater detail. Issue #3533 Change-Id: I33a3bd411d815e926d4bea2184e8d3ea69e2bb49
Okay. I've added 'downloadheadersreceived' and 'downloadfailed'. |
Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including |
In our use case it is important to be able to collect some key information regarding the player's network requests (for example, the download request for a media segment). In particular, we would like to measure the start time, header arrival time, completion time, and the response status code for each request individually.
For now we are able to achieve the goals above by registering our own networking plugin (XHR, http/https) through
shaka.net.NetworkingEngine.registerScheme()
. However, the solution isn't ideal because it will not work properly if there are more than one Shaka player instances on the same page. This is due to the fact that the registration of the networking plugin is handled globally for all player instances, there is no way for us to know which request is associated with which player instance in more complex scenarios.I believe there are several possible ways Shaka can help to make it easier to trace network requests:
When invoking the networking plugin method
parse(uri, request, requestType, progressUpdated)
, pass an extra argument "player" to reference the associated Shaka player instance. This way, we will be able to know which player a request belongs to.Introduce a new networking plugin or request interceptor which can be registered on a player instance-by-instance basis.
Introduce new Shaka player events which are triggered whenever a request started/progressed/ended with corresponding status code.
Thanks!
The text was updated successfully, but these errors were encountered: