Commit 224abad 1 parent 0b1dbb2 commit 224abad Copy full SHA for 224abad
File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,17 @@ where
153
153
let mut this = self . project ( ) ;
154
154
155
155
loop {
156
+ // We report before polling since we might have only blocking tasks meaning that the
157
+ // measure after the `poll_tasks_until_pending` will return 0, since all futures will
158
+ // be completed.
159
+ this. metrics
160
+ . active_tasks
161
+ . store ( this. tasks . len ( ) as u64 , Ordering :: Relaxed ) ;
162
+
156
163
this. tasks . as_mut ( ) . poll_tasks_until_pending ( cx) ;
157
164
158
- // We report how many tasks are being concurrently polled in this future.
165
+ // We also want to report after polling since we might have finished polling some futures
166
+ // and some not.
159
167
this. metrics
160
168
. active_tasks
161
169
. store ( this. tasks . len ( ) as u64 , Ordering :: Relaxed ) ;
You can’t perform that action at this time.
0 commit comments