metrics-rs / metrics

A metrics ecosystem for Rust.
MIT License
1.11k stars 156 forks source link

Add 'get' functions to Registry #457

Closed kathoum closed 7 months ago

kathoum commented 7 months ago

This adds public functions get_counter, get_gauge, get_histogram, that return a clone of the requested metric stored in the internal Storage.

This allows retrieving a copy of a single metric without creating a full HashMap clone.

tobz commented 6 months ago

Released in metrics-util@v0.16.3.

Thanks again for your contribution!