HomePhabricator

Restore ReadingDepth instrument

Description

Restore ReadingDepth instrument

This restores the ReadingDepth instrumentation which is intended to only
run on the Minerva and Vector skins.

This reverts commit 2bc5048d7b3c2f7e290dcad3a72938fec54c9b2f.
with some manual rebases.

Additional changes:

  • Switches to the native beforeunload event from the jquery

event

  • mw.track replaced with mw.eventLog
  • EVENT.$schema is added
  • Switch to hyphens for event names
  • Uses performance.now API instead of the mw.now() API
  • Uses the PerformanceNavigationTiming API instead of the now

deprecated PerformanceTiming API.

  • Changes how the total_length field is defined/implemented.

Previously the timer for total_length started at first paint if
available and otherwise used domInteractive as its starting point.
This implementation's timer for total_time starts at the moment that
the visibility change listener is added.

  • Changes how the visible_length field is defined/implemented. The

previous implementation's visibleLength field subtracted the
difference between firstPaint and domInteractive from the recorded
msPaused value. This implementation's visible_length field is
strictly equal to total_length - msPaused.

  • Removes pageTitle and pageToken fields for privacy reasons.
  • Adds page_length and access_method fields per request of data

analyst.

Depends-On: Ic74d3a5a7841527cdcac40850fd9645993404cd3
Bug: T294777
Change-Id: Ib94c6019f004fe3fcd877f62ff5208ec5e07d2a1
(cherry picked from commit e8e70ba5628148a5560fdb96f1622fae4297ba91)

Details

Provenance
JdlrobsonAuthored on Oct 29 2021, 7:47 PM
nrayCommitted on Nov 22 2021, 10:26 PM
Parents
rEWMV427e422768ff: We need some way to distinguish namespaces
Branches
Unknown
Tags
Unknown
References
refs/changes/13/740613/1
ChangeId
Ib94c6019f004fe3fcd877f62ff5208ec5e07d2a1