Skip to content

Introducing a better return type for fn percentiles(...) results #4

@thinkingfish

Description

@thinkingfish

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions