Skip to content

Commit

Permalink
Merge pull request #2357 from joske/feat/histogram_labels
Browse files Browse the repository at this point in the history
feat: histogram label
  • Loading branch information
howardwu authored Feb 15, 2024
2 parents 6e182c6 + 839175e commit b396a51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@ pub fn histogram<V: Into<f64>>(name: &'static str, value: V) {
let histogram = ::metrics::histogram!(name);
histogram.record(value.into());
}

pub fn histogram_label<V: Into<f64>>(name: &'static str, label_key: &'static str, label_value: String, value: V) {
::metrics::histogram!(name, label_key => label_value).record(value.into());
}

0 comments on commit b396a51

Please sign in to comment.