Interactions and Event Timing
Responsiveness
Problems:
End-to-end
Problem: determining ‘end’
Problem: aggregating
�pointerdown, touchstart, pointerup, touchend, mousedown, mouseup, click�
Problem: aggregating
We want to be able to enable tracking performance:
Proposed solution
Event Timing already exposes per-event information, so we can enable per-interaction information by adding some interaction identifier.
partial interface PerformanceEventTiming {
unsigned long long interactionID;
}
Example: longest duration
const processedInteractions = {};�observerCallback(list) {� entries.forEach(entry => {� if (processedInteractions[entry.interactionID])� continue;� processedInteractions[entry.interactionID] = true;� processInteraction(entries, entry.interactionID);�}
Example (cont)
�processInteraction(entries, id) {� const relevantEntries = entries.filter(� e => e.interactionID = id);� const interactionDuration = Math.max(relevantEntries.map(� e => e.duration));� // Send interactionDuration to analytics.�}
Alternatives considered
Thanks!