-
Notifications
You must be signed in to change notification settings - Fork 71
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
Spec console.timeStamp #140
Comments
Reusing this open issue to discuss a proposal to explore potential enhancements to the console.timeStamp API, which is a non-standard but it’s implemented in several major browsers. The goal is to improve its utility for customizing the Performance panel in developer tools, particularly in the context of modern web frameworks that often abstract the browser's underlying model. (This proposal is being submitted on behalf of the Chrome Page Quality team at Google). Explored Changes:Custom Measurements: Allow developers to add custom measurements to the Performance panel using console.timeStamp, in addition to the current instant markers. This could involve additional arguments to the API, such as a measurement name and a way to indicate the start and end time of the measurement. Use Cases:Debugging Complex Apps: In large applications, custom measurements could help isolate performance bottlenecks related to specific components or interactions. Framework and tools Integration: Developers using frameworks could add framework-specific performance metrics to the Performance panel, aligning it with their mental models. Considerations:
Alternative Approaches and why
|
instead of adding a as far as enhancements, i could see developers appreciating a way to suggest a color or category/importance. im generally favorable of the idea so long as it's not something binding (e.g. ignore the suggested color if it's too similar to the background, drop the category/importance if it's too long of a string, etc.) |
the reason we thought about
There are existing requests for something that achieves this specifically, for example: w3c/user-timing#109 & w3c/user-timing#25. Although these are requested for the UserTimings API, they could be added to the console.timeStamp API as well, since it's meant primarily for integrating with the browser's Performance tool.
Agreed. Also, these properties should be completely optional for the developer |
For my use case it's important that the API allows specifying both a
|
I like the idea of adding something like |
It makes sense to have something like this that's analogous to the ergonomics of
Thinking more about it as with your examples I think it can get very interesting this way |
Personally I think I'm convinced by your reasoning for pursuing this as a console API instead of extending existing performance APIs. @dcrousso, what do you think about this and @and-oli's reasoning for new APIs instead of
First, at a high level I lean towards following the design precedents articulated in w3ctag/design-principles#426 (comment), which would have us avoiding Second, instead of having the following overloads:
What about |
Don't feel strongly about it, but that would make it slightly harder to call the API in what's likely the most common use case of the API: adding a measurement without further options. With no dedicated overload you would have to use an object with a single property every time: These overloads take inspiration from the performance.measure syntax, which I believe had a similar reasoning. |
OK thanks for explaining, happy to not go against that precedent. |
This adds a minimal (vague) definition for the `timeStamp()` method, based on its current behavior across Chromium, Firefox, and Safari, and the MDN documentation[^1]. [^1]: https://developer.mozilla.org/en-US/docs/Web/API/console/timestamp_static Ref: whatwg#140
i can understand the rationale behind id much rather allow/encourage browsers to add UI that allows the developer to control where the data is shown (e.g. there could be a setting for "Timelines Tab: Show but i suppose we're kinda past that point a bit since as far as adding new things, the only major concern i have with |
See #27.
The text was updated successfully, but these errors were encountered: