Page MenuHomePhabricator

Add performance instrumentation to IP Info extension [M]
Closed, ResolvedPublic

Description

AC
  1. When the user clicks the (i) button and the popup is displayed, the time taken for the popup to be displayed is tracked
  2. When the user opens the accordion and info is displayed, the time taken for the info to be displayed is tracked
  3. If the accordion is rendered as open, the time taken between page load and the info being displayed is tracked
QA
AC 1
  1. Navigate to /wiki/Special:RecentChanges
  2. Click on the (i) button next to an IP
  3. Wait for the popup to be displayed
  4. Observe that an HTTP POST request is made to a URL like /beacon/statsv?MediaWiki.ipinfo_popup_delay=xxxms
  5. Click on the same (i) button
  6. Observe that no HTTP POST request is made to a URL like /beacon/statsv
AC 3
  1. Navigate to /wiki/Special:Contributions/$ip
  2. If the IP Information info box is not expanded, then expand it and refresh the page
  3. Wait for the info box to render
  4. Observe than an HTTP POST request is made to a URL like /beacon/statsv?mediaWiki.ipinfo_accordion_delay=xxxms
Notes

AC 1, 2, 3 can all be recorded as timers in Graphite using the following JavaScript snippet:

mw.track( 'timer.MediaWiki.ipinfo_popup_delay', foo );

// Or...

mw.track( 'timer.MediaWiki.ipinfo_accordion_delay', bar );

Event Timeline

From the description

This task depends on finalising a design - tagging @Prtksxna and @Niharika

The design now includes an accordion box on Special:Contribs along with the existing popup.

@Tchanders I remember you explaining something short-term we are doing about maintaining (or not maintaining) the open state of the accordion. Do we need designs for this before we can figure out the instrumentation?

@Tchanders I remember you explaining something short-term we are doing about maintaining (or not maintaining) the open state of the accordion. Do we need designs for this before we can figure out the instrumentation?

This is tracked in T290941: Preserve open/collapsed state of the accordion [M], which is quickly making its way across the board.

We can also instrument:

  • The time taken between the user opening the accordion and the info being displayed in it
  • If the accordion is rendered as open, then the time taken between page load and the info being displayed in the accordion

I'll break these out into a separate task as they can be instrumented in isolation.

phuedx renamed this task from WIP Add instrumentation to IP Info extension to Add performance instrumentation to IP Info extension.Oct 18 2021, 5:39 PM
phuedx updated the task description. (Show Details)
phuedx updated the task description. (Show Details)
ARamirez_WMF renamed this task from Add performance instrumentation to IP Info extension to Add performance instrumentation to IP Info extension [M].Oct 20 2021, 4:48 PM

Change 738258 had a related patch set uploaded (by TsepoThoabala; author: TsepoThoabala):

[mediawiki/extensions/IPInfo@master] Add performance instrumentation to IP Info extension

https://gerrit.wikimedia.org/r/738258

Change 738258 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Add performance instrumentation to IP Info extension

https://gerrit.wikimedia.org/r/738258

Confirmed http post loads and does not show afterwards when user clicks the IP info box, and IP recent changes page.
Screen shot:

Screen Shot 2021-12-07 at 8.36.41 PM.png (1×2 px, 698 KB)

Screen Shot 2021-12-07 at 11.05.49 AM.png (1×2 px, 529 KB)