File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ loop {
146146
147147## Getting Started With Runtime Metrics
148148
149- This unstable functionality requires ` tokio_unstable ` , and the ` rt ` crate
149+ Not all runtime metrics are stable. Using unstable metrics requires ` tokio_unstable ` , and the ` rt ` crate
150150feature. To enable ` tokio_unstable ` , the ` --cfg ` ` tokio_unstable ` must be passed
151151to ` rustc ` when compiling. You can do this by setting the ` RUSTFLAGS `
152152environment variable before compiling your application; e.g.:
Original file line number Diff line number Diff line change 5656//! ```
5757
5858#![ cfg_attr(
59- all ( tokio_unstable , feature = "rt" ) ,
59+ feature = "rt" ,
6060 doc = r##"
61- ### Monitoring runtime metrics (unstable)
61+ ### Monitoring runtime metrics
6262[Monitor][RuntimeMonitor] key [metrics][RuntimeMetrics] of a tokio runtime.
63- **This functionality requires `tokio_unstable ` and the crate feature `rt `.**
63+ **This functionality requires crate feature `rt ` and some metrics require `tokio_unstable `.**
6464
6565In the below example, a [`RuntimeMonitor`] is [constructed][RuntimeMonitor::new] and
6666three tasks are spawned and awaited; meanwhile, a fourth task prints [metrics][RuntimeMetrics]
@@ -104,7 +104,7 @@ async fn do_work() {
104104}
105105```
106106
107- ### Monitoring and publishing runtime metrics (unstable)
107+ ### Monitoring and publishing runtime metrics
108108
109109If the `metrics-rs-integration` feature is additionally enabled, this crate allows
110110publishing runtime metrics externally via [metrics-rs](metrics) exporters.
Original file line number Diff line number Diff line change @@ -1007,6 +1007,7 @@ pub struct RuntimeMetrics {
10071007 /// let mut next_interval = || intervals.next().unwrap();
10081008 ///
10091009 /// let interval = next_interval(); // end of interval 1
1010+ /// # #[cfg(tokio_unstable)]
10101011 /// assert_eq!(interval.num_remote_schedules, 0);
10111012 ///
10121013 /// // spawn a system thread outside of the runtime
@@ -1020,6 +1021,7 @@ pub struct RuntimeMetrics {
10201021 /// drop(runtime);
10211022 ///
10221023 /// let interval = next_interval(); // end of interval 2
1024+ /// # #[cfg(tokio_unstable)]
10231025 /// assert_eq!(interval.num_remote_schedules, 2);
10241026 /// # }
10251027 /// ```
You can’t perform that action at this time.
0 commit comments