Page MenuHomePhabricator

Separate frontend.navtiming metrics by browser family
Closed, ResolvedPublic

Description

Have the server fragment our frontend properties by browser_family using the ua-parser library server-side. We can wildcard over this for general graphs, but it allows us to draw a more realistic picture for individual browsers (and help pinpoint problems with specific browsers), since median of everything is not very representative of real users.

Details

Related Gerrit Patches:

Event Timeline

Krinkle created this task.Sep 14 2015, 9:41 PM
Krinkle raised the priority of this task from to Low.
Krinkle updated the task description. (Show Details)
Krinkle added a project: Performance-Team.
Krinkle added subscribers: Peter, Krinkle, Aklapper, ori.
Krinkle raised the priority of this task from Low to Needs Triage.Sep 15 2015, 2:18 AM
Krinkle set Security to None.

We'll need to get https://github.com/ua-parser/uap-python available on hafnium.

ori triaged this task as Medium priority.Sep 21 2015, 6:07 PM
ori claimed this task.Sep 21 2015, 6:10 PM
ori lowered the priority of this task from Medium to Low.
ori moved this task from Inbox to Backlog: Small & Maintenance on the Performance-Team board.
Krinkle added a comment.EditedSep 21 2015, 6:12 PM

While there, I'd like to request installing it on terbium as well so that we can reliably test and iterate our webperf scripts there before deploying on hafnium (see also T112660).

BTW, don't forget you can now consume (using eventlogging code or not) JSON directly from the Kafka eventlogging_NavigationTiming topic :)

Hm, also, this might not be a good idea, but could be worth considering: should eventlogging-processor do this for all client-side events so that the parsed UA is easily available for anyone to use? MAYYYBE maybe not :) Probably would make the processor work much harder ¯\_(ツ)_/¯

Hm, also, this might not be a good idea, but could be worth considering: should eventlogging-processor do this for all client-side events so that the parsed UA is easily available for anyone to use? MAYYYBE maybe not :) Probably would make the processor work much harder ¯\_(ツ)_/¯

It'd certainly simplify things a bit, but it may be better to merely make it available as a method for subscribers (rather than preprocess ahead of time). That way subscribers like Multimedia and NavTiming could do something like:

import eventlogging

events = eventlogging.connect( .. );
for meta in events.filter(schema='Edit', uaMap=True):
    event = meta['event']
    uaMap = meta['uaMap']
    print uaMap['browser']['family']
    print uaMap['browser']['major']

Though it's hardly advantageous compared to using the library directly:

import eventlogging
import user_agent_parser

events = eventlogging.connect( .. );
for meta in events.filter(schema='Edit'):
    event = meta['event']
    uaMap = user_agent_parser.parse(meta['userAgent'])
    print uaMap['user_agent']['family']
    print uaMap['user_agent']['major']

The main hurdle is getting uap-python packaged. Whether to install it on hafnium or eventlog1001 shouldn't matter much.

Krinkle raised the priority of this task from Low to Medium.Oct 2 2015, 10:08 PM
ori raised the priority of this task from Medium to High.Nov 16 2015, 7:52 PM

Change 254355 had a related patch set uploaded (by Ori.livneh):
webperf: log per-user-agent Navigation Timing data

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

Change 254355 merged by Ori.livneh:
webperf: log per-user-agent Navigation Timing data

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

Krinkle added a comment.EditedNov 20 2015, 5:11 AM

A few ideas:

  • Some of the iOS_%s_WebView and iOS_%s_other entries contain periods in the key segment causing them to clobber the space for Navigation Timing properties.
  • Let's break down browsers by version inside family to make it easier to group metrics from the same browser (e.g. navtiming.Chrome_Mobile.46.firstPaint).
  • Rename by_platform to by_browser. Also to avoid confusion with the $Platform variable we use for desktop vs mobile.
  • Rename the browsers to be more consistent with naming scheme of ua-parser per https://github.com/ua-parser/uap-core/blob/HEAD/regexes.yaml. E.g. "Chrome Mobile" (not Mobile Chrome), "Chrome Mobile iOS" (not CriOS), "Mobile Safari", "Mobile Safari WebView" etc. These names are more familiar to us I think, and also used by Analytics.
  • Maybe add a generic "Other" so that we're future-proof against what proportion of browsers is outside the ones we have regexes for.
Krinkle claimed this task.Jan 21 2016, 8:13 PM
Krinkle moved this task from Next In This Quarter to Doing on the Performance-Team board.

Change 271307 had a related patch set uploaded (by Krinkle):
navtiming: Improve parse_ua and add unit tests

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

Change 271307 merged by Ori.livneh:
navtiming: Improve parse_ua and add unit tests

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

Krinkle closed this task as Resolved.EditedFeb 21 2016, 2:01 AM