metric
metric copied to clipboard
More efficient approximate histogram
I think this solution may be more optimal than the one you have now.
https://stackoverflow.com/questions/8180336/histogram-approximation-for-streaming-data/8369381
It also consolidates bins when a sample doesn't fit into the last bin, but otherwise adds are O(1).