requires that a "limit" be specified ahead of time. Is there a principled way to increase or decrease this kind of limit over time, and have the new buckets contents "spill into each other"?
To smplify things, I'm using 5 buckets, but 32 would be better. Assume first bucket width is 1ms.
bucket range 0 x =< 1ms 1 1ms < x =< 2ms 2 2ms < x =< 4ms 3 4ms < x =< 8ms 5 8ms < x
The last bucket would be limited to 8ms < x <= 16 ms. If you find something > 16ms, then you have to rescale *before* you increment any of the buckets. Once you do, there is now room to hold it.
bucket range 0 x =< 2ms (sum of previous bucket 0 and previous bucket 1) 1 2ms < x =< 4ms 2 4ms < x =< 8ms 3 8ms < x =< 16ms