From d9be942fcd884d736769f4346b61678f3ac511ad Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Thu, 26 Dec 2024 15:24:47 -0500 Subject: [PATCH] Clarify doc comment --- tokio/src/runtime/builder.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index 4e0f7b9769b..c9a47c3862c 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -1245,9 +1245,10 @@ impl Builder { /// .unwrap(); /// ``` /// - /// Configure a `LogHistogram` with similar behavior to [`HistogramScale::Log`] + /// When migrating from the legacy histogram ([`HistogramScale::Log`]) and wanting + /// to match the previous behavior, use `precision_exact(0)`. This creates a histogram + /// where each bucket is twice the size of the previous bucket. /// ```rust - /// /// use std::time::Duration; /// use tokio::runtime::{HistogramConfiguration, LogHistogram}; /// let rt = tokio::runtime::Builder::new_current_thread() @@ -1255,8 +1256,8 @@ impl Builder { /// .enable_metrics_poll_time_histogram() /// .metrics_poll_time_histogram_configuration(HistogramConfiguration::log( /// LogHistogram::builder() - /// .max_value(Duration::from_millis(4)) /// .min_value(Duration::from_micros(20)) + /// .max_value(Duration::from_millis(4)) /// // Set `precision_exact` to `0` to match `HistogramScale::Log` /// .precision_exact(0) /// .max_buckets(10)