A few things we could improve:
- using a
HashMap instead of Vec makes the results easier to use;
- renaming the function to be
fn quantiles() which is a more accurate/correct description of the query;
- return the total count across all buckets, as it gives us a sense about the statistical meaningfulness of a specific quantile (e.g. the value of p99.9 from a histogram with 10 samples doesn't have the same statistical significance as p99.9 against a 1 million samples);
- return the Bucket for min (p0) and max (p100) to help contextualize the results for typical use cases;
- (requires changes to the
Histogram struct) track under- / over-flow of values and return them with the rest of the result.
A few things we could improve:
HashMapinstead ofVecmakes the results easier to use;fn quantiles()which is a more accurate/correct description of the query;Histogramstruct) track under- / over-flow of values and return them with the rest of the result.