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.

Event Timeline

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.
ori triaged this task as Medium priority.Sep 21 2015, 6:07 PM
ori lowered the priority of this task from Medium to Low.

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.

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

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.

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