Skip to content

Commit

Permalink
Clarify doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoh committed Dec 26, 2024
1 parent eaffd4b commit d9be942
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tokio/src/runtime/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,18 +1245,19 @@ 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()
/// .enable_all()
/// .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)
Expand Down

0 comments on commit d9be942

Please sign in to comment.