Skip to content

Commit 0977b25

Browse files
committed
docs: Updated after stablizing runtime metrics
1 parent 20c70c8 commit 0977b25

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
150150
feature. To enable `tokio_unstable`, the `--cfg` `tokio_unstable` must be passed
151151
to `rustc` when compiling. You can do this by setting the `RUSTFLAGS`
152152
environment variable before compiling your application; e.g.:

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@
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
6565
In the below example, a [`RuntimeMonitor`] is [constructed][RuntimeMonitor::new] and
6666
three 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
109109
If the `metrics-rs-integration` feature is additionally enabled, this crate allows
110110
publishing runtime metrics externally via [metrics-rs](metrics) exporters.

src/runtime.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
/// ```

0 commit comments

Comments
 (0)