Skip to content

Commit

Permalink
metriken: documentation comment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingfish authored Aug 13, 2023
1 parent 4862334 commit 7a91771
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions metriken/derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ mod metric;
///
/// Note that this will change the type of the generated static to be
/// `MetricInstance<MetricTy>`. It implements both [`Deref`] and [`DerefMut`]
/// so it can be used much the same as a normal static.
/// so it can be used much the same as a normal static.
///
/// # Parameters
/// - (optional) `crate`: The path to the `rustcommon_metrics` crate. This
/// allows the `metric` macro to be used within other macros that get exported
/// to third-party crates which may not have added `rustcommon_metrics` to
/// their Cargo.toml.
/// - (optional) `crate`: The path to the `metriken` crate. This allows the
/// `metric` macro to be used within other macros that get exported to
/// third-party crates which may not have added `metriken` to their
/// Cargo.toml.
/// - (optional) `formatter`: A function to be used to determine the output name
/// for this metric.
///
Expand Down
2 changes: 2 additions & 0 deletions metriken/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub enum Format {
Prometheus,
}

/// The default formatter supports Prometheus-style exposition, and otherwise
/// simply prints the metric name.
pub fn default_formatter(metric: &MetricEntry, format: Format) -> String {
match format {
Format::Prometheus => {
Expand Down

0 comments on commit 7a91771

Please sign in to comment.