forked from prometheus/client_rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(metrics): add Summary implementation
This commit introduces the `Summary` metric type for the Rust Prometheus client, addressing the requirements outlined in prometheus#40. ### Key Highlights: - Implements the `Summary` type to represent summary statistics such as sum, count, and quantiles. - The implementation does not include a specific quantile calculation algorithm. Users are expected to provide precomputed quantiles based on their chosen algorithm. - Supports encoding summary metrics following the OpenMetrics standard. ### Details: - `Summary` provides: - `reset` method to update its internal state with sum, count, and quantiles. - Integration with the `TypedMetric` and `EncodeMetric` traits to support encoding and registration with the Prometheus client. - Documentation and tests have been added to ensure correct usage and behavior. - This implementation is designed to give users flexibility in handling quantile computation. ### Notes: - Future work could explore integrating popular quantile calculation algorithms to offer built-in support while retaining the option for custom implementations.
- Loading branch information
1 parent
12923ca
commit 8a3419c
Showing
5 changed files
with
500 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.