File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ version = "0.2.1"
371
371
372
372
# Async runtime
373
373
[workspace .dependencies .tokio ]
374
- version = " 1.44.2 "
374
+ version = " 1.45.0 "
375
375
features = [" full" ]
376
376
377
377
[workspace .dependencies .tokio-stream ]
Original file line number Diff line number Diff line change @@ -126,7 +126,6 @@ pub fn observe(metrics: RuntimeMetrics) {
126
126
. build ( ) ;
127
127
}
128
128
129
- #[ cfg( tokio_unstable) ]
130
129
{
131
130
let metrics = metrics. clone ( ) ;
132
131
METER
@@ -144,6 +143,19 @@ pub fn observe(metrics: RuntimeMetrics) {
144
143
. build ( ) ;
145
144
}
146
145
146
+ #[ cfg( tokio_unstable) ]
147
+ {
148
+ let metrics = metrics. clone ( ) ;
149
+ METER
150
+ . u64_observable_counter ( "tokio_runtime.spawned_tasks_count" )
151
+ . with_description ( "The number of tasks spawned in this runtime since it was created." )
152
+ . with_unit ( "{task}" )
153
+ . with_callback ( move |instrument| {
154
+ instrument. observe ( metrics. spawned_tasks_count ( ) , & [ ] ) ;
155
+ } )
156
+ . build ( ) ;
157
+ }
158
+
147
159
#[ cfg( tokio_unstable) ]
148
160
{
149
161
let metrics = metrics. clone ( ) ;
@@ -163,7 +175,6 @@ pub fn observe(metrics: RuntimeMetrics) {
163
175
. build ( ) ;
164
176
}
165
177
166
- #[ cfg( tokio_unstable) ]
167
178
{
168
179
let metrics = metrics. clone ( ) ;
169
180
METER
@@ -247,7 +258,6 @@ pub fn observe(metrics: RuntimeMetrics) {
247
258
. build ( ) ;
248
259
}
249
260
250
- #[ cfg( tokio_unstable) ]
251
261
{
252
262
let metrics = metrics. clone ( ) ;
253
263
METER
@@ -416,7 +426,6 @@ pub fn observe(metrics: RuntimeMetrics) {
416
426
}
417
427
418
428
/// Helper to construct a [`KeyValue`] with the worker index.
419
- #[ allow( dead_code) ]
420
429
fn worker_idx ( i : usize ) -> KeyValue {
421
430
KeyValue :: new ( "worker_idx" , i. try_into ( ) . unwrap_or ( i64:: MAX ) )
422
431
}
You can’t perform that action at this time.
0 commit comments