3 ms·
The basic problem is something like this: - Minute 1: 10 requests, 5 with 10ms latency, 5 with 500ms latency; avg latency 255ms - Minute 2: 1000 requests, 900
by simiones 6y ago
The basic problem is something like this:
- Minute 1: 10 requests, 5 with 10ms latency, 5 with 500ms latency; avg latency 255ms
- Minute 2: 1000 requests, 900 with 10ms latency, 100 with 500ms latency; avg latency 59ms
Average of averages: 157ms
Average latency: 97ms
You can make them arbitrarily different.
- squeaky-clean 6y agoBut you can make this work if you also just store the number of samples per bucket, right? > (255ms + 59ms) / 2 = 157ms But > ((10 * 255ms) + (1000 * 59ms)) / 1010 = 60.94ms Which is the same answer I get as averaging all the samples without bucketing. (I can't get 97ms though)
- klodolph 6y agoThe example is an illustration of “if you collect the wrong data, you can’t calculate the statistics you want.” So if your response is, “can’t you just collect the correct data in the first place?” Well, that’s the hard part.
- deleted 6y ago[deleted]