title: getting the average, p95 and p99 of a stream of data
body: <p>I have incoming data and I want to compute the average, 95th and 99th percentile of that data - I am most interested in the last 1000 values. At any time, I'd like to query this object to get any of the three values (this can occur at any time, not just when the numbers seen mod 1000 is 0). Is there a way to get these three values without keeping the last 1000 samples?</p>
  
  <p>This doesn't have to be perfect so we can use some tricks to get a good estimate. Also, speed is another concern. Thanks</p>
  
  <p>(I will be doing this in C++ but I don't think that matters all that much)</p>