This commit is contained in:
Helen Grachtz 2025-03-24 18:48:50 +00:00 committed by GitHub
commit 35726e79ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -61,7 +61,7 @@ where
self.insert_at(key, self.default_entry_timeout); self.insert_at(key, self.default_entry_timeout);
} }
/// Inserts an entry that will expire at a given instant. If the entry already exists, the /// Inserts an entry that will expire at a given duration. If the entry already exists, the
/// timeout is updated. /// timeout is updated.
pub fn insert_at(&mut self, key: K, entry_duration: Duration) { pub fn insert_at(&mut self, key: K, entry_duration: Duration) {
if self.contains(&key) { if self.contains(&key) {

View File

@ -5,7 +5,7 @@
//! //!
//! - `Histogram`: used with `start_timer(..)` and `stop_timer(..)` to record durations (e.g., //! - `Histogram`: used with `start_timer(..)` and `stop_timer(..)` to record durations (e.g.,
//! block processing time). //! block processing time).
//! - `IncCounter`: used to represent an ideally ever-growing, never-shrinking integer (e.g., //! - `IntCounter`: used to represent an ideally ever-growing, never-shrinking integer (e.g.,
//! number of block processing requests). //! number of block processing requests).
//! - `IntGauge`: used to represent a varying integer (e.g., number of attestations per block). //! - `IntGauge`: used to represent a varying integer (e.g., number of attestations per block).
//! //!
@ -78,7 +78,7 @@ pub fn try_create_int_counter(name: &str, help: &str) -> Result<IntCounter> {
Ok(counter) Ok(counter)
} }
/// Attempts to create an `IntGauge`, returning `Err` if the registry does not accept the counter /// Attempts to create an `IntGauge`, returning `Err` if the registry does not accept the gauge
/// (potentially due to naming conflict). /// (potentially due to naming conflict).
pub fn try_create_int_gauge(name: &str, help: &str) -> Result<IntGauge> { pub fn try_create_int_gauge(name: &str, help: &str) -> Result<IntGauge> {
let opts = Opts::new(name, help); let opts = Opts::new(name, help);
@ -87,7 +87,7 @@ pub fn try_create_int_gauge(name: &str, help: &str) -> Result<IntGauge> {
Ok(gauge) Ok(gauge)
} }
/// Attempts to create a `Gauge`, returning `Err` if the registry does not accept the counter /// Attempts to create a `Gauge`, returning `Err` if the registry does not accept the gauge
/// (potentially due to naming conflict). /// (potentially due to naming conflict).
pub fn try_create_float_gauge(name: &str, help: &str) -> Result<Gauge> { pub fn try_create_float_gauge(name: &str, help: &str) -> Result<Gauge> {
let opts = Opts::new(name, help); let opts = Opts::new(name, help);
@ -96,7 +96,7 @@ pub fn try_create_float_gauge(name: &str, help: &str) -> Result<Gauge> {
Ok(gauge) Ok(gauge)
} }
/// Attempts to create a `Histogram`, returning `Err` if the registry does not accept the counter /// Attempts to create a `Histogram`, returning `Err` if the registry does not accept the histogram
/// (potentially due to naming conflict). /// (potentially due to naming conflict).
pub fn try_create_histogram(name: &str, help: &str) -> Result<Histogram> { pub fn try_create_histogram(name: &str, help: &str) -> Result<Histogram> {
let opts = HistogramOpts::new(name, help); let opts = HistogramOpts::new(name, help);
@ -105,7 +105,7 @@ pub fn try_create_histogram(name: &str, help: &str) -> Result<Histogram> {
Ok(histogram) Ok(histogram)
} }
/// Attempts to create a `HistogramVec`, returning `Err` if the registry does not accept the counter /// Attempts to create a `HistogramVec`, returning `Err` if the registry does not accept the histogram
/// (potentially due to naming conflict). /// (potentially due to naming conflict).
pub fn try_create_histogram_vec( pub fn try_create_histogram_vec(
name: &str, name: &str,
@ -144,7 +144,7 @@ pub fn try_create_float_gauge_vec(
Ok(counter_vec) Ok(counter_vec)
} }
/// Attempts to create a `IntCounterVec`, returning `Err` if the registry does not accept the gauge /// Attempts to create a `IntCounterVec`, returning `Err` if the registry does not accept the counter
/// (potentially due to naming conflict). /// (potentially due to naming conflict).
pub fn try_create_int_counter_vec( pub fn try_create_int_counter_vec(
name: &str, name: &str,