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

Provide a way to associate warnings with measurements #25

Closed
gaearon opened this issue Mar 3, 2017 · 9 comments
Closed

Provide a way to associate warnings with measurements #25

gaearon opened this issue Mar 3, 2017 · 9 comments
Milestone

Comments

@gaearon
Copy link

gaearon commented Mar 3, 2017

Not sure if this is in scope of the API, but built-in browser timings can show potential perf bottlenecks in their UI:

screen shot 2017-03-03 at 2 48 14 pm

I'd like to have a way to do the same with user timing. We need a way to highlight measurements that may not be long per se, but trigger cascading effects later (just like a reflow). For now, I am trying to emulate this with an emoji:

screen shot 2017-03-03 at 2 54 17 pm

However I wish there was a standard way of attaching such meta information to the user timing. Then the browser could highlight problematic measurements differently and call attention to them even if they're not long.

@gaearon gaearon changed the title Provide a way to mark measures as bottlenecks for better visualization Provide a way to associate warnings with measurements Mar 3, 2017
@igrigorik
Copy link
Member

We've discussed this before at length and closed it as a wont-fix, see #3.

That said, perhaps something we can revisit in context of w3c/charter-webperf#28..? :)

@gaearon
Copy link
Author

gaearon commented Mar 4, 2017

I’m not proposing to associate arbitrary payloads with marks like in #3 per se because browsers then wouldn’t interpret generic userland payloads in any special way.

I’m proposing a way to mark measurements as needing attention, so that the browsers can implement a special way to display them (similar to what they already do for built-in events). If you don't consider DevTools to be one of primary use cases of User Timing API, this could also be useful in logs (think a severity field).

@eliperelman
Copy link

From what I can recall of previous conversations in Mozilla, there was a lot of pushback for using userland as informative for platform indicators. For devtooling I could see this as a possibility, but anything more than that is also likely to see pushback.

Also a little more context: #6

@gaearon
Copy link
Author

gaearon commented Mar 4, 2017

To be clear, I’m not suggesting to expose platform indicators through User Timings. I only use the existing platform indicators as prior art for coupling measurements with warnings in a flame chart.

My use case is library-specific: we as a library want to flag certain User Timings measured by us as needing attention. They are not related to the platform, but to known bad patterns specific to our library. What we need is a mechanism to make some User Timings have greater severity so that the browsers can highlight them, and the user can notice them immediately from a large flame chart.

@igrigorik
Copy link
Member

Do all the devtools vendors provide a ~consistent enum to indicate priority of different messages?

If you don't consider DevTools to be one of primary use cases of User Timing API

That's the crux of it.. When UT first came around, I don't think that was the goal. That said, now that CDT is showing UT, we've seen a big uptick in usage, and I think that's something we want to encourage. With that in mind, perhaps we ought to rethink and revisit if we consider DT to be a key customer.

/cc @toddreifsteck

@toddreifsteck
Copy link
Member

FWIW, I assert that devs using dev tools ARE a key consumer. @nolanlawson and I currently evangelize the fact that user timing show up in dev tools as a key reason to use mark/measure rather than rolling a standalone solution.

At the same time, as @eliperelman suggests, we should NOT be adding a lot of dev tool-only goo to user land.

The concept of a severity is interesting, but... it seems that may be awkward to set at the time performance.mark or performance.measure are called. Would that also require the ability to new a mark/measure and insert it directly?

@npm1
Copy link
Contributor

npm1 commented Mar 11, 2019

UserTiming L3 provides a detail field for marks and measures where you can store metadata. Integration with DevTools is a separate issue but I don't think 'severity' is a primitive we'd want to include. I propose closing this. Thoughts?

@igrigorik
Copy link
Member

I'd love to get input from folks working on DevTools and some JS framework authors before we close this out. My hunch is that you are right and new detail field should address many of the previous requests, but there is still value in formalizing some common fields — using emoji's to signal warnings and severity is a clever hack, but I think we can do better.

I'll start a thread with some Chrome folks..

@yoavweiss
Copy link
Contributor

I think that similarly to #68, this can be solved by the namespaces idea discussed in #86 (where devtools would highlight certain UT namespaces). Closing as a duplicate. Let's continue discussion on #68.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants