Skip to content

WIP: Client Timing Statistics

Andrew Newdigate requested to merge an/poc-client-timing-stats into master

Proof-of-Concept!

What does this MR do?

This is a fully functioning proof-of-concept showing how we can easily record real world usage timing statistics for GitLab.com (and other instances) with very few code changes.

Why do this?

Currently GitLab.com performance is measured using Pingdom and blackbox testing of a small set of known URLs.

The response times are used as an indicator of user experience, but in my opinion it's a terrible proxy for real data:

  1. The small set of URLs used in the tests does reflect the usage our users are performing
  2. Blackbox tests measure on a single component of the time it takes for a browser page to render.

Here are a list of things that have a huge impact on user experience which are not reflected in our current testing:

  1. Size of response. Most blackbox testing occurs from the cloud to the cloud. Real users have slower connections so large HTML payloads are far slower in reality.
    1. Related: compressed responses.
  2. Usage of, and performance of, CDN for serving static content.
  3. Size of Javascript payload and effect on parse performance
  4. Best practices around resource loading (asynchronous loading, etc)
  5. Correct caching headers
  6. Preloading (DNS, resources, http/2 push in future,, etc)
  7. etc

All of these components have a major influence on the time it takes to render a page on GitLab.com, but currently we have no data that reflects whether they're good or bad - and more importantly whether they're getting better or worse.

Our current approach is to optimise for a single set of URLs. This makes it easy to optimise for a local maximum while ignoring the bigger picture.

What does it do?

This MR measures the actual response times on GitLab.com of real-world users and stores the data in Prometheus histograms.

It uses the actual data recorded by the browser, a much better metric to optimise against, since it includes all factors that impact the browser rendering times.

Graph of Results

This graph shows the average amount of time it takes for a webpage to be fully loaded. The data is obviously very granular since I don't have a great deal of data locally.

image

Prometheus Query:

sum(rate(client_browser_timing_sum[10m])) / sum(rate(client_browser_timing_count[10m]))
Edited by Andrew Newdigate

Merge request reports