-
Notifications
You must be signed in to change notification settings - Fork 34
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 "group" concept to performance timeline #9
Conversation
There is a need for a common concept of an "event group" in the Performance Timeline, which would allow the UA to associate one or more distinct events (of same or different types) into a logical group. Some examples of where this is necessary: - Nav Timing: nav request -> one or more redirects -> destination - Res Timing: cors preflight -> request; multi-part/resumed fetch - Frame Timing: main frame -> one or more composite events - ... and so on. In each of the above cases the UA can assign a common group to indicate that the events share a common parent. In turn, the developer can check the group ID of each event and fetch other associated events if necessary - e.g. follow a redirect chain; fetch render+composite events, and so on. This commit adds the following concepts: - adds "group" identifier to PerformanceEntry - adds getEntriesByGroup() to Performance Timeline
Another example: ServerTiming grouped with the corresponding ResourceTiming entry |
Is it worth it to have a second optional parameter for eg:
|
I'm not sure it makes sense to merge these use cases across domains. Group means very different things, and assumes that This Group is The Only Group. Suppose we add other groupings down the road? What do we do then? I can't help but think that the real bug here that we want a getEntriesMatching(predicate) and then we can add domain-specific fields. |
@natduca I'm not sure what you mean by "domain". The "group" is simply an arbitrary unique ID (UUID, integer counter, or some such) that can be used to link multiple records into a logical group. As such, there are no restrictions on number of groups or how they should be used to link records together -- it's just a key to group things. Perhaps "group" is not the best choice of name, but I haven't been able to come up with anything substantially better so far -- if you have any suggestions, lmk! @nicjansma ah, right, that's another great use case - good call. |
Another possible use case would be adding group to user-timing to record relation to frame-timing or synchronous resource-timing. |
Thinking about this some more, and with benefit of lots of great feedback from various folks... A "group" is formed by a common key between two entities. In the case of Performance objects recorded in the timeline, any two objects with the same attribute (and optionally, some predicate on the value) can be said to form a group. The simplest example are the existing
Of course, the same pattern applies to any arbitrary set of attribute name/value's. As long as any two entries share a common attribute, they can be "grouped" by applying the same filtering steps; they can also belong to "multiple groups" by having multiple attributes, and so on. In other words, we can do much better than imposing a single "group" attribute...
Maybe, as a convenience, we could/should consider exposing a simple convenience method that can make this easier, and that explains our existing methods... For the sake of an example:
More importantly though, we first need to ensure that existing PerformanceEntry records that ought to be linked surface some common attribute key/value's:
... and so on. WDYT? Crazy talk? :) |
@igrigorik Given this design, I wonder if it makes sense to allow attributes to be added to User Timing entries. |
@lawnsea if we end up going down this route, it may.. but I think that's a whole separate discussion. |
@igrigorik Ok. An example usecase we have at @bazaarvoice right now where grouping User Timing entries might be convenient is Dapper/Zipkin-style tracing of client-side code. |
@igrigorik I'm happy to open a bug on the User Timing repo if that's the right place for this discussion. |
@lawnsea Added an issue to UserTiming w3c/user-timing#3 |
Closing, superseded by #11. |
There is a need for a common concept of an "event group" in the Performance Timeline, which would allow the UA to associate one or more distinct events (of same or different types) into a logical group.
Some examples of where this is necessary:
In each of the above cases the UA can assign a common group to indicate that the events share a common parent. In turn, the developer can check the group ID of each event and fetch other associated events if necessary - e.g. follow a redirect chain; fetch render+composite events, and so on.
This commit adds the following concepts: