On Tue, May 20, 2014 at 6:18 AM, Nuria Ruiz <nuria@wikimedia.org> wrote:
>>>[gerco] - whenever we display geometric means, we weight by sampling rate (exp(sum(sampling_rate * ln(value)) / sum(sampling_rate)) instead of exp(avg(ln(value))))

>>[gilles] I don't follow the logic here. Like percentiles, averages should be unaffected by sampling, geometric or not.

>[gerco]Assume we have 10 duration logs with  1 sec time and 10 with 2 sec; the (arithmetic) mean is 1.5 sec. If the >second group is sampled 1:10, and we take the average of that, that would give 1.1 sec; our one sample from the >second group really represents 10 events, but only has the weight of one. The same logic should hold for geometric >means.
What variable are we measuring with this data that we are averaging?

The duration log shows the total time it takes for the viewer to load itself and the image data (milliseconds between clicking on the thumbnail and displaying the image).
We want to sample this on large wikis since it generates a lot of data.
We want to not sample this on small wikis since they generate very little data and the sampling would make it unreliable.

We want to display average loading time for each wiki as decisions to enable/disable by default on that wiki should be informed by that stat (some wikis can have very different loading times due to network geographics).
We also want to display global average loading time, which is an average of all the logged loading times (which, per above, use different sampling).
We might event want to display per-country loading times, which is an even more random mix of data from different wikis.