Performance/Real user monitoring

From Wikitech

Real user monitoring involves collecting RUM metrics from readers that browse the live Wikipedia.org site.

RUM metrics provide valuable insights in the following ways:

  • How well Wikipedia is performing in terms of important things like how fast it loads (Google Web Vitals and other user experience metrics). This information helps us identify any issues or problems that may have occurred, so that we can fix them and ensure a great user experience for everyone visiting Wikipedia.
  • It allows us to gain insights into how people from all over the world are using Wikipedia and how well it is working for them. We can understand their experience and performance while using Wikipedia, which helps us make improvements to ensure that it is enjoyable and efficient for users regardless of their location.
  • It helps us understand the conditions in which our users access Wikipedia, such as the speed of their device's CPU and internet connection. This information allows us to ensure that Wikipedia performs well for everyone, regardless of their location or the type of device they are using. It helps us optimize the experience so that all users can access Wikipedia's knowledge without any issues or delays.

Metrics

Main article: Performance/Metrics#navtiming

The metrics include: Page Load Time, Time to First Paint, Time to First Byte, CPU Benchmark, Google Web Vitals, and much more.

The data is sliced by device (mobile/desktop skin, browser family), geography (continent, country), and several other factors.

Dashboards

Check Grafana for full list of dashboards that explore the navtiming dataset.

How we collect metrics

We collect performance metrics from page views using the NavigationTiming extension for MediaWiki. This extension automatically activates on a sample of MediaWiki page views in production. The values are provided to MediaWiki via the W3C Navigation Timing and Paint Timing APIs that are built-in to every web browser.

The NavigationTiming exension sends the collected metrics via a beacon back to Wikipedia.org, and then through a couple layers make their way to Graphite and Prometheus. For more details about the metric flow, refer to the infrastructure runbook and diagram.

WMF Performance Team infrastructure

How to add a new metric

If you have new metric that needs to be added there are usually a couple of steps that you need to follow.

  1. First, you need to collect the actual metric in the https://www.mediawiki.org/wiki/Extension:NavigationTiming extension. Do that by clone the repository, add the new metric and add tests for it. Depending on when the metric appear in the browser you can send it with the Navigation Timing event or create a new event for your metric.
  2. Create a new schema or edit the navtiming schema in the schema repository.
  3. Update navtiming.py and push the metric to Prometheus.
  4. Create/update a graph/dashboard in Grafana to to make the metric visible.

See also