Skip to content

Commit

Permalink
Corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Dec 25, 2023
1 parent 448e9b5 commit 74b5abd
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ All user visible changes to this project will be documented in this file. This p
- Upgraded to 0.22 version of `metrics` crate. ([#9])
- Upgraded to 0.16 version of `metrics-util` crate. ([#9])

[#5]: /../../pull/9
[#9]: /../../pull/9



Expand Down
20 changes: 12 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,34 +191,37 @@ pub use self::{
};

/// Tries to install a default [`Recorder`] (backed by the
/// [`prometheus::default_registry()`]) with [`metrics::set_global_recorder()`].
/// [`prometheus::default_registry()`]) with the
/// [`metrics::set_global_recorder()`].
///
/// # Errors
///
/// If the [`Recorder`] fails to be installed with
/// If the [`Recorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
pub fn try_install() -> Result<Recorder, metrics::SetRecorderError<Recorder>> {
Recorder::builder().try_build_and_install()
}

/// Tries to install a default [`FreezableRecorder`] (backed by the
/// [`prometheus::default_registry()`]) with [`metrics::set_global_recorder()`].
/// [`prometheus::default_registry()`]) with the
/// [`metrics::set_global_recorder()`].
///
/// # Errors
///
/// If the [`FreezableRecorder`] fails to be installed with
/// If the [`FreezableRecorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
pub fn try_install_freezable(
) -> Result<FreezableRecorder, metrics::SetRecorderError<FreezableRecorder>> {
Recorder::builder().try_build_freezable_and_install()
}

/// Installs a default [`Recorder`] (backed by the
/// [`prometheus::default_registry()`]) with [`metrics::set_global_recorder()`].
/// [`prometheus::default_registry()`]) with the
/// [`metrics::set_global_recorder()`].
///
/// # Panics
///
/// If the [`Recorder`] fails to be installed with
/// If the [`Recorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
// We do intentionally omit `#[must_use]` here, as we don't want to force
// library users using the returned `Recorder` directly.
Expand All @@ -228,11 +231,12 @@ pub fn install() -> Recorder {
}

/// Installs a default [`FreezableRecorder`] (backed by the
/// [`prometheus::default_registry()`]) with [`metrics::set_global_recorder()`].
/// [`prometheus::default_registry()`]) with the
/// [`metrics::set_global_recorder()`].
///
/// # Panics
///
/// If the [`FreezableRecorder`] fails to be installed with
/// If the [`FreezableRecorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
// We do intentionally omit `#[must_use]` here, as we don't want to force
// library users using the returned `FreezableRecorder` directly.
Expand Down
34 changes: 17 additions & 17 deletions src/recorder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ pub struct Builder<
failure_strategy: FailureStrategy,

/// [`metrics::Layer`]s to wrap the built [`Recorder`] with upon its
/// installation with [`metrics::set_global_recorder()`].
/// installation with the [`metrics::set_global_recorder()`].
///
/// [`metrics::Layer`]: Layer
layers: Layers,
Expand Down Expand Up @@ -744,7 +744,7 @@ impl<S, L> Builder<S, L> {
/// # Usage
///
/// Use this method if you want to:
/// - either install the built [`Recorder`] with
/// - either install the built [`Recorder`] with the
/// [`metrics::set_global_recorder()`] manually;
/// - or to compose the built [`Recorder`] with some other
/// [`metrics::Recorder`]s (like being able to write into multiple
Expand Down Expand Up @@ -778,7 +778,7 @@ impl<S, L> Builder<S, L> {
/// # Usage
///
/// Use this method if you want to:
/// - either install the built [`FreezableRecorder`] with
/// - either install the built [`FreezableRecorder`] with the
/// [`metrics::set_global_recorder()`] manually;
/// - or to compose the built [`FreezableRecorder`] with some other
/// [`metrics::Recorder`]s (like being able to write into multiple
Expand Down Expand Up @@ -814,7 +814,7 @@ impl<S, L> Builder<S, L> {
/// # Usage
///
/// Use this method if you want to:
/// - either install the built [`FrozenRecorder`] with
/// - either install the built [`FrozenRecorder`] with the
/// [`metrics::set_global_recorder()`] manually;
/// - or to compose the built [`FrozenRecorder`] with some other
/// [`metrics::Recorder`]s (like being able to write into multiple
Expand All @@ -840,11 +840,11 @@ impl<S, L> Builder<S, L> {
}

/// Builds a [`Recorder`] out of this [`Builder`] and tries to install it
/// with [`metrics::set_global_recorder()`].
/// with the [`metrics::set_global_recorder()`].
///
/// # Errors
///
/// If the built [`Recorder`] fails to be installed with
/// If the built [`Recorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
///
/// # Example
Expand Down Expand Up @@ -922,11 +922,11 @@ impl<S, L> Builder<S, L> {
}

/// Builds a [`FreezableRecorder`] out of this [`Builder`] and tries to
/// install it with [`metrics::set_global_recorder()`].
/// install it with the [`metrics::set_global_recorder()`].
///
/// # Errors
///
/// If the built [`FreezableRecorder`] fails to be installed with
/// If the built [`FreezableRecorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
///
/// # Example
Expand Down Expand Up @@ -997,15 +997,15 @@ impl<S, L> Builder<S, L> {
}

/// Builds a [`FrozenRecorder`] out of this [`Builder`] and tries to install
/// it with [`metrics::set_global_recorder()`].
/// it with the [`metrics::set_global_recorder()`].
///
/// Returns the [`prometheus::Registry`] backing the installed
/// [`FrozenRecorder`], as there is nothing you can configure with the
/// installed [`FrozenRecorder`] itself.
///
/// # Errors
///
/// If the built [`FrozenRecorder`] fails to be installed with
/// If the built [`FrozenRecorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
///
/// # Example
Expand Down Expand Up @@ -1070,12 +1070,12 @@ impl<S, L> Builder<S, L> {
Ok(storage.prometheus)
}

/// Builds a [`Recorder`] out of this [`Builder`] and installs it with
/// Builds a [`Recorder`] out of this [`Builder`] and installs it with the
/// [`metrics::set_global_recorder()`].
///
/// # Panics
///
/// If the built [`Recorder`] fails to be installed with
/// If the built [`Recorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
///
/// # Example
Expand Down Expand Up @@ -1146,11 +1146,11 @@ impl<S, L> Builder<S, L> {
}

/// Builds a [`FreezableRecorder`] out of this [`Builder`] and installs it
/// with [`metrics::set_global_recorder()`].
/// with the [`metrics::set_global_recorder()`].
///
/// # Panics
///
/// If the built [`FreezableRecorder`] fails to be installed with
/// If the built [`FreezableRecorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
///
/// # Example
Expand Down Expand Up @@ -1210,15 +1210,15 @@ impl<S, L> Builder<S, L> {
}

/// Builds a [`FrozenRecorder`] out of this [`Builder`] and installs it with
/// [`metrics::set_global_recorder()`].
/// the [`metrics::set_global_recorder()`].
///
/// Returns the [`prometheus::Registry`] backing the installed
/// [`FrozenRecorder`], as there is nothing you can configure with the
/// installed [`FrozenRecorder`] itself.
///
/// # Panics
///
/// If the built [`FrozenRecorder`] fails to be installed with
/// If the built [`FrozenRecorder`] fails to be installed with the
/// [`metrics::set_global_recorder()`].
///
/// # Example
Expand Down Expand Up @@ -1280,7 +1280,7 @@ impl<S, L> Builder<S, L> {

impl<S, H, T> Builder<S, layer::Stack<H, T>> {
/// Adds the provided [`metrics::Layer`] to wrap the built [`Recorder`] upon
/// its installation with [`metrics::set_global_recorder()`].
/// its installation with the [`metrics::set_global_recorder()`].
///
/// # Example
///
Expand Down

0 comments on commit 74b5abd

Please sign in to comment.