Percentiles of Live Data Capture
问题 I am looking for an algorithm that determines percentiles for live data capture. For example, consider the development of a server application. The server might have response times as follows: 17 ms 33 ms 52 ms 60 ms 55 ms etc. It is useful to report the 90th percentile response time, 80th percentile response time, etc. The naive algorithm is to insert each response time into a list. When statistics are requested, sort the list and get the values at the proper positions. Memory usages scales