@@ -71,11 +71,11 @@ impl RuntimeMetrics {
71
71
}
72
72
73
73
/// Returns the number of tasks currently scheduled in the runtime's
74
- /// injection queue.
74
+ /// global queue.
75
75
///
76
76
/// Tasks that are spawned or notified from a non-runtime thread are
77
- /// scheduled using the runtime's injection queue. This metric returns the
78
- /// **current** number of tasks pending in the injection queue. As such, the
77
+ /// scheduled using the runtime's global queue. This metric returns the
78
+ /// **current** number of tasks pending in the global queue. As such, the
79
79
/// returned value may increase or decrease as new tasks are scheduled and
80
80
/// processed.
81
81
///
@@ -88,11 +88,11 @@ impl RuntimeMetrics {
88
88
/// async fn main() {
89
89
/// let metrics = Handle::current().metrics();
90
90
///
91
- /// let n = metrics.injection_queue_depth ();
92
- /// println!("{} tasks currently pending in the runtime's injection queue", n);
91
+ /// let n = metrics.global_queue_depth ();
92
+ /// println!("{} tasks currently pending in the runtime's global queue", n);
93
93
/// }
94
94
/// ```
95
- pub fn injection_queue_depth ( & self ) -> usize {
95
+ pub fn global_queue_depth ( & self ) -> usize {
96
96
self . handle . inner . injection_queue_depth ( )
97
97
}
98
98
@@ -681,6 +681,13 @@ impl RuntimeMetrics {
681
681
}
682
682
}
683
683
684
+ /// Renamed to [`RuntimeMetrics::global_queue_depth`]
685
+ #[ deprecated = "Renamed to global_queue_depth" ]
686
+ #[ doc( hidden) ]
687
+ pub fn injection_queue_depth( & self ) -> usize {
688
+ self . handle. inner. injection_queue_depth( )
689
+ }
690
+
684
691
/// Returns the number of tasks currently scheduled in the given worker's
685
692
/// local queue.
686
693
///
0 commit comments