Based on discussion in
HBASE-6261 and with some HDFS devs, I'd like to make better high-percentile latency metrics a part of hadoop-common.
I've already got a working implementation of , an efficient algorithm for estimating quantiles on a stream of values. It allows you to specify arbitrary quantiles to track (e.g. 50th, 75th, 90th, 95th, 99th), along with tight error bounds. This estimator can be snapshotted and reset periodically to get a feel for how these percentiles are changing over time.
I propose creating a new MutableQuantiles class that does this.  isn't completely without overhead (~1MB memory for reasonably sized windows), which is why I hesitate to add it to the existing MutableStat class.
 Cormode, Korn, Muthukrishnan, and Srivastava. "Effective Computation of Biased Quantiles over Data Streams" in ICDE 2005.