louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
57.67k stars 5.21k forks source link

Use median response time instead of average response time #977

Open JonasDoesThings opened 2 years ago

JonasDoesThings commented 2 years ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

Other

🔖 Feature description

From my view the goal of the average response time is to show the typical request. If that's the goal, the median should represent this better.

It’s common to see the average response time of a service reported. (Strictly speaking, the term “average” doesn’t refer to any particular formula, but in practice it is usually understood as the arithmetic mean: given n values, add up all the values, and divide by n.) However, the mean is not a very good metric if you want to know your “typical” response time, because it doesn’t tell you how many users actually experienced that delay.

Usually it is better to use percentiles. If you take your list of response times and sort it from fastest to slowest, then the median is the halfway point: for example, if your median response time is 200ms, that means half your requests return in less than 200ms, and half your requests take longer than that.

(Martin Kleppmann (2017) Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems, pp.14-15)

✔️ Solution

Replace the average with median response time.

❓ Alternatives

No response

📝 Additional Context

Further reading:

rezzorix commented 2 years ago

Shouldnt be a big deal to implement both "mean average" and "median average". Maybe even with a selection to show either a single value or both values.