Bug 223256

Summary: Web Inspector: add GridOverlay diagnostic event and related hooks
Product: WebKit Reporter: Razvan Caliman <rcaliman>
Component: Web InspectorAssignee: Razvan Caliman <rcaliman>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, ews-watchlist, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch bburg: review+, ews-feeder: commit-queue-

Razvan Caliman
Reported 2021-03-16 08:39:15 PDT
Add telemetry for usage of CSS Grid Inspector
Attachments
Patch (10.79 KB, patch)
2021-03-16 08:55 PDT, Razvan Caliman
no flags
Patch (11.61 KB, patch)
2021-03-16 10:58 PDT, Razvan Caliman
bburg: review+
ews-feeder: commit-queue-
Radar WebKit Bug Importer
Comment 1 2021-03-16 08:39:43 PDT
Razvan Caliman
Comment 2 2021-03-16 08:55:39 PDT
Created attachment 423335 [details] Patch patch for requesting feedback
Blaze Burg
Comment 3 2021-03-16 09:54:56 PDT
Comment on attachment 423335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423335&action=review > Source/WebInspectorUI/UserInterface/Base/Main.js:587 > + WI.diagnosticController.addRecorder(new WI.GridOverlayDiagnosticEventRecorder(WI.diagnosticController)); Nit: add backend feature check (InspectorBackend.supports("DOM.showGridOverlay") or similar) > Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:65 > + options[value] = value; As discussed, we should always include all the keys we know about and use 0 or 1 for booleans. What do you think about collecting whether the grid overlay was drawn with a non-default color? (Probably need to query the overlay manager to determine this in a sane way) > Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:74 > +WI.GridOverlayDiagnosticEventRecorder.TriggerType = { Let's call this 'Initiator' which is a more common terminology in our codebase for hints like this.
Devin Rousso
Comment 4 2021-03-16 10:14:13 PDT
Comment on attachment 423335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423335&action=review >> Source/WebInspectorUI/UserInterface/Base/Main.js:587 >> + WI.diagnosticController.addRecorder(new WI.GridOverlayDiagnosticEventRecorder(WI.diagnosticController)); > > Nit: add backend feature check (InspectorBackend.supports("DOM.showGridOverlay") or similar) NIT: I'd also put this last (grid overlay is likely not as important/used as target types or tab stuff) > Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:53 > + // While changing the overlay color, WI.OverlayManager.Event.GridOverlayShown is dispatched with high frequency. > + // A trigger is not provided so as not to skew usage count of overlay options. I feel like this would be better at the call site, not here. > Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:57 > + let usedOptions = [ IMO this is kinda odd. Is there a way to do this more declaratively without `reduce`? > Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:62 > + "showAreaNames" Style: missing comma
Razvan Caliman
Comment 5 2021-03-16 10:58:55 PDT
Razvan Caliman
Comment 6 2021-03-16 11:09:42 PDT
Comment on attachment 423335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423335&action=review >>> Source/WebInspectorUI/UserInterface/Base/Main.js:587 >>> + WI.diagnosticController.addRecorder(new WI.GridOverlayDiagnosticEventRecorder(WI.diagnosticController)); >> >> Nit: add backend feature check (InspectorBackend.supports("DOM.showGridOverlay") or similar) > > NIT: I'd also put this last (grid overlay is likely not as important/used as target types or tab stuff) @BJ, I think you meant `InspectorBackend.hasCommand("DOM.showGridOverlay")` @Devin, ok. >> Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:53 >> + // A trigger is not provided so as not to skew usage count of overlay options. > > I feel like this would be better at the call site, not here. Good idea. Moved. >> Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:57 >> + let usedOptions = [ > > IMO this is kinda odd. Is there a way to do this more declaratively without `reduce`? Declarative done. >> Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:65 >> + options[value] = value; > > As discussed, we should always include all the keys we know about and use 0 or 1 for booleans. > > What do you think about collecting whether the grid overlay was drawn with a non-default color? (Probably need to query the overlay manager to determine this in a sane way) Made them integers with the expectation that these will be summed-up over time. That's what we're interested in anyway: which options are most used. We may switch to booleans if we expect to use them as such and if the views allow us to filter the data as we need it. >> Source/WebInspectorUI/UserInterface/Controllers/GridOverlayDiagnosticEventRecorder.js:74 >> +WI.GridOverlayDiagnosticEventRecorder.TriggerType = { > > Let's call this 'Initiator' which is a more common terminology in our codebase for hints like this. Done!
Blaze Burg
Comment 7 2021-03-16 11:14:15 PDT
Comment on attachment 423356 [details] Patch r=me
Blaze Burg
Comment 8 2021-03-17 14:39:26 PDT
Note You need to log in before you can comment on or make changes to this bug.