Average time spent in restaurant in a time interval

There is a stream of numbers coming. At any point of time i might need 10% random numbers. I obviously don't want to store the entire stream...

say they all are the time spent by customers in restraunt. So i want to query what is the avg time spent in the restraunt between a particular time interval and as my normal table is pretty large , i want to do it over sampled data. The problem of grabbing 10% at a time is if i always receive say less then 10 message in batch , then 10% will always be null