The NavigationTiming extension currently has hardcoded logic to oversample FirstPaint data from Asia - this is being used to collect extra data in preparation for Singapore going live, so that we can more clearly see the effect of this change. Collected data is submitted to a statsd metric name.
It would be useful to be able to oversample NavTiming data for additional criteria as well, and to be able to configure this without having to write new code each time. A specific example where this would have been useful is the release of FF57, as we would be able to collect a fairly large data set on actual end user performance relatively quickly, without polluting our general sample.
Things that are needed in ext.NavigationTiming.js:
# Enhance the Event object so that it includes a boolean value indicating whether it is an oversample
# Add a generic method that checks whether oversampling is enabled at all
# Add a method that checks whether Geo oversampling (country or region) is enabled
# Add a method that checks whether User-Agent oversampling is enabled
# Emit non-oversampled event if needed
# Emit oversampled event if needed. This does mean that certain events will be collected twice. They will end up in different locations, so this is okay.
Things that are needed in the NavigationTiming schema:
# Add the oversample boolean (default: false)
Things that are needed in webperf.py:
# Check the oversample boolean, if it exists, and direct the collected event appropriately.
Depending on oversample rate, this could increase the number of items on the NavigationTiming queue in Kafka by quite a bit. Need to check with the Analytics team to ensure that this won't be an issue.