id
stringlengths
22
133
text
stringlengths
40
40.2k
arch
stringclasses
1 value
syntax
stringclasses
1 value
kind
stringclasses
4 values
repo
stringclasses
27 values
path
stringlengths
5
116
license
stringclasses
6 values
commit
stringlengths
40
40
source_host
stringclasses
1 value
category
stringclasses
16 values
source_url
stringlengths
85
196
line_start
int64
1
4.28k
line_end
int64
4
4.31k
tokio-rs/tokio:tokio/tests/rt_unstable_eager_driver_handoff.rs:4
let good_task = tokio::spawn(async move { let mut buf = [0u8; 1]; pipe2_rx.read_exact(&mut buf).await.unwrap(); deadlock_tx.send(()).unwrap(); }); tokio::time::sleep(Duration::from_millis(100)).await; pipe1_tx.write_all(&[1]).await.un...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_eager_driver_handoff.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_eager_driver_handoff.rs
121
149
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:1
#![warn(rust_2018_idioms)] #![cfg(all( feature = "full", tokio_unstable, not(target_os = "wasi"), target_has_atomic = "64" ))] use std::future::Future; use std::sync::{mpsc, Arc, Mutex}; use std::task::Poll; use std::thread; use tokio::macros::support::poll_fn; use tokio::runtime::{HistogramConfigurat...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
1
60
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:2
#[test] fn num_idle_blocking_threads() { let rt = current_thread(); assert_eq!(0, rt.metrics().num_idle_blocking_threads()); let _ = rt.block_on(rt.spawn_blocking(move || {})); rt.block_on(async { time::sleep(Duration::from_millis(5)).await; }); // We need to wait until the blocking thr...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
41
100
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:3
} assert_eq!(1, handle.metrics().num_idle_blocking_threads()); // Drop the runtime, which triggers shutdown and joins all blocking // threads. Before the fix for #6439, the shutdown path incremented // num_idle_threads a second time for each idle worker, so this // counter stayed at 1 instead of go...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
81
140
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:4
let _ = rt.block_on(h1); let _ = rt.block_on(h2); assert_eq!(0, rt.metrics().blocking_queue_depth()); } #[test] fn spawned_tasks_count() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(0, metrics.spawned_tasks_count()); rt.block_on(rt.spawn(async move { assert_eq!(...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
121
180
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:5
}) }) .join() .unwrap(); rt.block_on(task).unwrap(); assert_eq!(1, rt.metrics().remote_schedule_count()); let rt = threaded(); let handle = rt.handle().clone(); let task = thread::spawn(move || { handle.spawn(async { // DO nothing }) }) .join() ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
161
220
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:6
assert_eq!(Some(thread_id), metrics.worker_thread_id(0)); // Move runtime back to this thread. rt.block_on(async {}); assert_eq!(Some(thread::current().id()), metrics.worker_thread_id(0)); } #[test] fn worker_thread_id_threaded() { let rt = threaded(); let metrics = rt.metrics(); rt.block_on(...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
201
260
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:7
|| metrics.worker_thread_id(this_worker) == Some(thread_id) ); })) .unwrap() } #[test] fn worker_noop_count() { // There isn't really a great way to generate no-op parks as they happen as // false-positive events under concurrency. let rt = current_thread(); let metrics = rt.metrics();...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
241
300
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:8
// This is expected behaviour, we just retry until we succeed or // exhaust all tries, the latter causing this test to fail. try_spawn_stealable_task().await.is_ok() }); drop(rt); if successfully_spawned_stealable_task { let n: u64 = (0..metrics.num_workers(...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
281
340
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:9
// Does not populate the histogram assert!(!metrics.poll_time_histogram_enabled()); for i in 0..10 { assert_eq!(0, metrics.poll_time_histogram_bucket_count(0, i)); } let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(tas...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
321
380
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:10
let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(HistogramConfiguration::log( LogHistogram::builder() .max_value(Duration::from_secs(60)) .min_value(Du...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
361
420
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:11
fn minimal_log_histogram() { let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(HistogramConfiguration::log( LogHistogram::builder() .max_value(Duration::from_millis...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
401
460
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:12
} #[test] fn log_histogram_default_configuration() { let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(HistogramConfiguration::log( LogHistogram::default(), )) .bu...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
441
500
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:13
]; for rt in rts { let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}).await.unwrap(); } }); drop(rt); let num_workers = metrics.num_workers(); let num_buckets = metrics.poll_time_histogram_n...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
481
540
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:14
// ensure the old methods work too #[allow(deprecated)] let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_count_histogram_scale(tokio::runtime::HistogramScale::Log) .metrics_poll_count_histogram_buckets(3) ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
521
580
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:15
.unwrap(), ]; for rt in rts { let metrics = rt.metrics(); assert!(!metrics.poll_time_histogram_enabled()); } } #[test] fn worker_local_schedule_count() { let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { tokio::spawn(async {}).await.unwrap(); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
561
620
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:16
#[test] fn worker_overflow_count() { // Only applies to the threaded worker let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async { // Move to the runtime tokio::spawn(async { let (tx1, rx1) = std::sync::mpsc::channel(); let (tx2, rx2) = std::sync::mp...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
601
660
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:17
.map(|i| metrics.worker_overflow_count(i)) .sum(); assert_eq!(1, n); } #[test] fn worker_local_queue_depth() { const N: usize = 100; let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}); } as...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
641
700
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:18
// Spawn some tasks for _ in 0..100 { tokio::spawn(async {}); } let n: usize = (0..metrics.num_workers()) .map(|i| metrics.worker_local_queue_depth(i)) .sum(); assert_eq!(n, N); tx2.send(()).unwrap(); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
681
740
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:19
})); assert_eq!(1, rt.metrics().budget_forced_yield_count()); } #[test] fn budget_exhaustion_yield_with_joins() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(0, metrics.budget_forced_yield_count()); let mut did_yield_1 = false; let mut did_yield_2 = false; // block...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
721
780
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:20
did_yield_2 = true; return Poll::Pending; } }) ) }); assert_eq!(1, rt.metrics().budget_forced_yield_count()); } #[cfg(any(target_os = "linux", target_os = "macos"))] #[test] fn io_driver_fd_count() { let rt = current_thread(); let metrics = rt.me...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
761
820
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:21
} async fn try_spawn_stealable_task() -> Result<(), mpsc::RecvTimeoutError> { // We use a blocking channel to synchronize the tasks. let (tx, rx) = mpsc::channel(); // Make sure we are in the context of the runtime. tokio::spawn(async move { // Spawn the task that sends to the channel. ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
801
853
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:22
fn threaded_no_lifo() -> Runtime { tokio::runtime::Builder::new_multi_thread() .worker_threads(2) .disable_lifo_slot() .enable_all() .build() .unwrap() } fn us(n: u64) -> Duration { Duration::from_micros(n) }
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17
github
async-runtime
https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/tests/rt_unstable_metrics.rs
841
853
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:17
.map(|i| metrics.worker_overflow_count(i)) .sum(); assert_eq!(1, n); } #[test] fn worker_local_queue_depth() { const N: usize = 100; let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}); } as...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
654d38b13228a13498e793d8bb4f6ba50fd1016a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/654d38b13228a13498e793d8bb4f6ba50fd1016a/tokio/tests/rt_unstable_metrics.rs
641
700
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:18
// Make sure the no-op task has terminated so that it doesn't end up // in the LIFO slot and throw off our counts. let _ = nop.await; // Spawn some tasks for _ in 0..100 { tokio::spawn(async {}); } let n: usize = (0..metrics.num_w...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
654d38b13228a13498e793d8bb4f6ba50fd1016a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/654d38b13228a13498e793d8bb4f6ba50fd1016a/tokio/tests/rt_unstable_metrics.rs
681
740
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:19
if fut.poll(cx).is_pending() { did_yield = true; return Poll::Pending; } })); assert_eq!(1, rt.metrics().budget_forced_yield_count()); } #[test] fn budget_exhaustion_yield_with_joins() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(0, metrics.b...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
654d38b13228a13498e793d8bb4f6ba50fd1016a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/654d38b13228a13498e793d8bb4f6ba50fd1016a/tokio/tests/rt_unstable_metrics.rs
721
780
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:20
let fut = consume_budget(); tokio::pin!(fut); if fut.poll(cx).is_pending() { did_yield_2 = true; return Poll::Pending; } }) ) }); assert_eq!(1, rt.metrics().budget_forced_yield_count()); } #[cfg(any(ta...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
654d38b13228a13498e793d8bb4f6ba50fd1016a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/654d38b13228a13498e793d8bb4f6ba50fd1016a/tokio/tests/rt_unstable_metrics.rs
761
820
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:21
let stream = tokio::net::TcpStream::connect("google.com:80"); let _stream = rt.block_on(async move { stream.await.unwrap() }); assert_eq!(metrics.io_driver_ready_count(), 1); } async fn try_spawn_stealable_task() -> Result<(), mpsc::RecvTimeoutError> { // We use a blocking channel to synchronize the tasks...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
654d38b13228a13498e793d8bb4f6ba50fd1016a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/654d38b13228a13498e793d8bb4f6ba50fd1016a/tokio/tests/rt_unstable_metrics.rs
801
857
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:22
.enable_all() .build() .unwrap() } fn threaded_no_lifo() -> Runtime { tokio::runtime::Builder::new_multi_thread() .worker_threads(2) .disable_lifo_slot() .enable_all() .build() .unwrap() } fn us(n: u64) -> Duration { Duration::from_micros(n) }
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
654d38b13228a13498e793d8bb4f6ba50fd1016a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/654d38b13228a13498e793d8bb4f6ba50fd1016a/tokio/tests/rt_unstable_metrics.rs
841
857
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:15
.unwrap(), ]; for rt in rts { let metrics = rt.metrics(); assert!(!metrics.poll_time_histogram_enabled()); } } #[test] fn worker_local_schedule_count() { let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { tokio::spawn(async {}).await.unwrap(); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
eeb55c733ba9a83c51d08b1629dca6a5ec0f4b2b
github
async-runtime
https://github.com/tokio-rs/tokio/blob/eeb55c733ba9a83c51d08b1629dca6a5ec0f4b2b/tokio/tests/rt_unstable_metrics.rs
561
620
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:2
#[test] fn num_idle_blocking_threads() { let rt = current_thread(); assert_eq!(0, rt.metrics().num_idle_blocking_threads()); let _ = rt.block_on(rt.spawn_blocking(move || {})); rt.block_on(async { time::sleep(Duration::from_millis(5)).await; }); // We need to wait until the blocking thr...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
41
100
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:3
}; let h1 = rt.spawn_blocking(wait_until_ready.clone()); let h2 = rt.spawn_blocking(wait_until_ready); assert!(rt.metrics().blocking_queue_depth() > 0); drop(guard); let _ = rt.block_on(h1); let _ = rt.block_on(h2); assert_eq!(0, rt.metrics().blocking_queue_depth()); } #[test] fn spawne...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
81
140
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:4
fn remote_schedule_count() { use std::thread; let rt = current_thread(); let handle = rt.handle().clone(); let task = thread::spawn(move || { handle.spawn(async { // DO nothing }) }) .join() .unwrap(); rt.block_on(task).unwrap(); assert_eq!(1, rt.metric...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
121
180
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:5
// Move runtime to another thread. let thread_id = std::thread::scope(|scope| { let join_handle = scope.spawn(|| { rt.block_on(async {}); }); join_handle.thread().id() }); assert_eq!(Some(thread_id), metrics.worker_thread_id(0)); // Move runtime back to this thread. ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
161
220
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:6
panic!("worker did not move to new thread"); }); // After blocking task worker either stays on new thread or // is moved back to current thread. assert!( metrics.worker_thread_id(this_worker) == Some(moved_thread_id) || metrics.worker_thread_id(this_worker) =...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
201
260
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:7
for _ in 0..10 { let rt = threaded_no_lifo(); let metrics = rt.metrics(); let successfully_spawned_stealable_task = rt.block_on(async { // The call to `try_spawn_stealable_task` may time out, which means // that the sending task couldn't be scheduled due to a deadlock in...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
241
300
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:8
for _ in 0..N { tokio::spawn(task()).await.unwrap(); } }); drop(rt); assert_eq!(N, metrics.worker_poll_count(0)); // Not currently supported for current-thread runtime assert_eq!(Duration::default(), metrics.worker_mean_poll_time(0)); // Does not populate the histogram a...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
281
340
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:9
assert_eq!(0, metrics.poll_time_histogram_bucket_count(n, i)); } } } #[test] fn log_histogram() { const N: u64 = 50; let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(Histogra...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
321
380
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:10
let n = (0..metrics.num_workers()) .flat_map(|i| (0..num_buckets).map(move |j| (i, j))) .map(|(worker, bucket)| metrics.poll_time_histogram_bucket_count(worker, bucket)) .sum(); assert_eq!(N, n); } #[test] fn minimal_log_histogram() { let rt = tokio::runtime::Builder::new_current_thread...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
361
420
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:11
.enable_metrics_poll_time_histogram() .metrics_poll_count_histogram_scale(HistogramScale::Log) .metrics_poll_count_histogram_resolution(Duration::from_micros(50)) .metrics_poll_count_histogram_buckets(20) .build() .unwrap(); let num_buckets = rt.metrics().poll_time_histogram_...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
401
460
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:12
.enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(HistogramConfiguration::linear( Duration::from_millis(50), 3, )) .build() .unwrap(), ]; for rt in rts { let metrics ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
441
500
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:13
.metrics_poll_time_histogram_configuration(HistogramConfiguration::linear(us(50), 3)) .build() .unwrap(); let metrics = rt.metrics(); assert_eq!(metrics.poll_time_histogram_bucket_range(0), us(0)..us(50)); assert_eq!(metrics.poll_time_histogram_bucket_range(1), us(50)..us(100)); assert_...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
481
540
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:14
tokio::runtime::Builder::new_multi_thread() .worker_threads(2) .enable_all() .metrics_poll_time_histogram_configuration(HistogramConfiguration::linear( Duration::from_millis(50), 3, )) .build() .unwrap(), ]; ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
521
580
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:15
let n: u64 = (0..metrics.num_workers()) .map(|i| metrics.worker_local_schedule_count(i)) .sum(); assert_eq!(2, n); assert_eq!(1, metrics.remote_schedule_count()); } #[test] fn worker_overflow_count() { // Only applies to the threaded worker let rt = threaded(); let metrics = rt.met...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
561
620
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:16
tx2.send(()).unwrap(); }) .await .unwrap(); }); drop(rt); let n: u64 = (0..metrics.num_workers()) .map(|i| metrics.worker_overflow_count(i)) .sum(); assert_eq!(1, n); } #[test] fn worker_local_queue_depth() { const N: usize = 100; let rt = current_thre...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
601
660
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:17
rx2.recv().unwrap(); }); // Bump the next-run spawn tokio::spawn(async {}); rx1.recv().unwrap(); // Spawn some tasks for _ in 0..100 { tokio::spawn(async {}); } let n: usize = (0..metrics.num_workers()) ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
641
700
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:18
let fut = consume_budget(); tokio::pin!(fut); if fut.poll(cx).is_pending() { did_yield = true; return Poll::Pending; } })); assert_eq!(1, rt.metrics().budget_forced_yield_count()); } #[test] fn budget_exhaustion_yield_with_joins() { let rt = current_thread(...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
681
740
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:19
if did_yield_2 { return Poll::Ready(()); } let fut = consume_budget(); tokio::pin!(fut); if fut.poll(cx).is_pending() { did_yield_2 = true; return Poll::Pending; } })...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
721
780
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:20
fn io_driver_ready_count() { let rt = current_thread(); let metrics = rt.metrics(); let stream = tokio::net::TcpStream::connect("google.com:80"); let _stream = rt.block_on(async move { stream.await.unwrap() }); assert_eq!(metrics.io_driver_ready_count(), 1); } async fn try_spawn_stealable_task() ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
761
820
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:21
fn threaded() -> Runtime { tokio::runtime::Builder::new_multi_thread() .worker_threads(2) .enable_all() .build() .unwrap() } fn threaded_no_lifo() -> Runtime { tokio::runtime::Builder::new_multi_thread() .worker_threads(2) .disable_lifo_slot() .enable_all...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
0ce3a1188a56c4c133d5b789eb366c0752e9b22c
github
async-runtime
https://github.com/tokio-rs/tokio/blob/0ce3a1188a56c4c133d5b789eb366c0752e9b22c/tokio/tests/rt_unstable_metrics.rs
801
821
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:5
// Move runtime to another thread. let thread_id = std::thread::scope(|scope| { let join_handle = scope.spawn(|| { rt.block_on(async {}); }); join_handle.thread().id() }); assert_eq!(Some(thread_id), metrics.worker_thread_id(0)); // Move runtime back to this thread. ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
161
220
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:6
panic!("worker did not move to new thread"); }); // After blocking task worker either stays on new thread or // is moved back to current thread. assert!( metrics.worker_thread_id(this_worker) == Some(moved_thread_id) || metrics.worker_thread_id(this_worker) =...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
201
260
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:7
assert!(2 <= metrics.worker_park_unpark_count(0)); let rt = threaded(); let metrics = rt.metrics(); // Wait for workers to be parked after runtime startup. for _ in 0..100 { if 1 <= metrics.worker_park_unpark_count(0) && 1 <= metrics.worker_park_unpark_count(1) { break; } ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
241
300
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:8
time::sleep(Duration::from_millis(1)).await; }); drop(rt); assert!(0 < metrics.worker_noop_count(0)); let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async { time::sleep(Duration::from_millis(1)).await; }); drop(rt); assert!(0 < metrics.worker_noop_count(0)); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
281
340
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:9
} } panic!("exhausted every try to schedule the stealable task"); } #[test] fn worker_poll_count_and_time() { const N: u64 = 5; async fn task() { // Sync sleep std::thread::sleep(std::time::Duration::from_micros(10)); } let rt = current_thread(); let metrics = rt.metrics(...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
321
380
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:10
drop(rt); // Account for the `block_on` task let n = (0..metrics.num_workers()) .map(|i| metrics.worker_poll_count(i)) .sum(); assert_eq!(N, n); let n: Duration = (0..metrics.num_workers()) .map(|i| metrics.worker_mean_poll_time(i)) .sum(); assert!(n > Duration::de...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
361
420
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:11
rt.block_on(async { for _ in 0..N { tokio::spawn(async {}).await.unwrap(); } }); drop(rt); assert_eq!( metrics.poll_time_histogram_bucket_range(0), Duration::from_nanos(0)..Duration::from_nanos(96) ); assert_eq!( metrics.poll_time_histogram_bucket_...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
401
460
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:12
for b in 1..num_buckets - 1 { let range = metrics.poll_time_histogram_bucket_range(b); let size = range.end - range.start; // Assert the buckets continue doubling in size assert_eq!( size, Duration::from_nanos((1 << (b - 1)) * 16384), "incorrect range ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
441
500
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:13
} #[test] fn worker_poll_count_histogram() { const N: u64 = 5; let rts = [ tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(HistogramConfiguration::linear( Du...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
481
540
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:14
assert!(metrics.poll_time_histogram_enabled()); assert_eq!(num_buckets, 3); let n = (0..num_workers) .flat_map(|i| (0..num_buckets).map(move |j| (i, j))) .map(|(worker, bucket)| metrics.poll_time_histogram_bucket_count(worker, bucket)) .sum(); assert_eq!(N, n...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
521
580
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:15
let b = a * 2; assert_eq!(metrics.poll_time_histogram_bucket_range(0), us(0)..a); assert_eq!(metrics.poll_time_histogram_bucket_range(1), a..b); assert_eq!(metrics.poll_time_histogram_bucket_range(2), b..max); } #[test] fn worker_poll_count_histogram_disabled_without_explicit_enable() { let rts = [ ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
561
620
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:16
tokio::spawn(async {}).await.unwrap(); }); drop(rt); assert_eq!(1, metrics.worker_local_schedule_count(0)); assert_eq!(0, metrics.remote_schedule_count()); let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async { // Move to the runtime tokio::spawn(async { ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
601
660
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:17
// // We spawn from outside the runtime to ensure that the other worker // will pick it up: // <https://github.com/tokio-rs/tokio/issues/4730> tokio::task::spawn_blocking(|| { tokio::spawn(async move { tx1.send(()).unwrap(); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
641
700
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:18
tokio::spawn(async {}); } assert_eq!(N, metrics.worker_local_queue_depth(0)); }); let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async move { // Move to the runtime tokio::spawn(async move { let (tx1, rx1) = std::sync::mpsc::channel(); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
681
740
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:19
.unwrap(); }); } #[test] fn budget_exhaustion_yield() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(0, metrics.budget_forced_yield_count()); let mut did_yield = false; // block on a task which consumes budget until it yields rt.block_on(poll_fn(|cx| loop { i...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
721
780
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:20
// block on a task which consumes budget until it yields rt.block_on(async { tokio::join!( poll_fn(|cx| loop { if did_yield_1 { return Poll::Ready(()); } let fut = consume_budget(); tokio::pin!(fut); ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
761
820
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:21
let metrics = rt.metrics(); assert_eq!(metrics.io_driver_fd_registered_count(), 0); let stream = tokio::net::TcpStream::connect("google.com:80"); let stream = rt.block_on(async move { stream.await.unwrap() }); assert_eq!(metrics.io_driver_fd_registered_count(), 1); assert_eq!(metrics.io_driver_fd...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
801
860
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:22
}); // Blocking receive on the channel, timing out if the sending task // wasn't scheduled in time. rx.recv_timeout(Duration::from_secs(1)) }) .await .unwrap()?; Ok(()) } fn current_thread() -> Runtime { tokio::runtime::Builder::new_current_thread() .enable_all() ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
afd3678f89dd0253af9194a4945711cfd3c0662a
github
async-runtime
https://github.com/tokio-rs/tokio/blob/afd3678f89dd0253af9194a4945711cfd3c0662a/tokio/tests/rt_unstable_metrics.rs
841
879
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:15
let b = a * 2; assert_eq!(metrics.poll_time_histogram_bucket_range(0), us(0)..a); assert_eq!(metrics.poll_time_histogram_bucket_range(1), a..b); assert_eq!(metrics.poll_time_histogram_bucket_range(2), b..max); } #[test] fn worker_poll_count_histogram_disabled_without_explicit_enable() { let rts = [ ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
561
620
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:16
let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async { tokio::task::yield_now().await; }) .await .unwrap(); } }); drop(rt); assert!(zero < metrics.worker_total_...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
601
660
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:17
let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { tokio::spawn(async {}).await.unwrap(); }); drop(rt); assert_eq!(1, metrics.worker_local_schedule_count(0)); assert_eq!(0, metrics.remote_schedule_count()); let rt = threaded(); let metrics = rt.metrics()...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
641
700
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:18
// First, we need to block the other worker until all tasks have // been spawned. // // We spawn from outside the runtime to ensure that the other worker // will pick it up: // <https://github.com/tokio-rs/tokio/issues/4730> tokio::task::spawn_bloc...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
681
740
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:19
let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}); } assert_eq!(N, metrics.worker_local_queue_depth(0)); }); let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async move { // Move to the runtime tok...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
721
780
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:20
tx2.send(()).unwrap(); }) .await .unwrap(); }); } #[test] fn budget_exhaustion_yield() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(0, metrics.budget_forced_yield_count()); let mut did_yield = false; // block on a task which consumes budget unti...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
761
820
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:21
let mut did_yield_1 = false; let mut did_yield_2 = false; // block on a task which consumes budget until it yields rt.block_on(async { tokio::join!( poll_fn(|cx| loop { if did_yield_1 { return Poll::Ready(()); } let fu...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
801
860
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:22
#[test] fn io_driver_fd_count() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(metrics.io_driver_fd_registered_count(), 0); let stream = tokio::net::TcpStream::connect("google.com:80"); let stream = rt.block_on(async move { stream.await.unwrap() }); assert_eq!(metrics.io_...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
841
900
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:23
// this task stealable. tokio::spawn(async move { tx.send(()).unwrap(); }); // Blocking receive on the channel, timing out if the sending task // wasn't scheduled in time. rx.recv_timeout(Duration::from_secs(1)) }) .await .unwrap()?; Ok(()) } fn cur...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad
github
async-runtime
https://github.com/tokio-rs/tokio/blob/7f09959b0a13cbea2b0e5c20ec1b7ac3f208dbad/tokio/tests/rt_unstable_metrics.rs
881
922
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:1
#![allow(unknown_lints, unexpected_cfgs)] #![warn(rust_2018_idioms)] #![cfg(all( feature = "full", tokio_unstable, not(target_os = "wasi"), target_has_atomic = "64" ))] use std::future::Future; use std::sync::{mpsc, Arc, Mutex}; use std::task::Poll; use std::thread; use tokio::macros::support::poll_fn;...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
1
60
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:3
let _unused = ready_cloned.lock().unwrap(); }; let h1 = rt.spawn_blocking(wait_until_ready.clone()); let h2 = rt.spawn_blocking(wait_until_ready); assert!(rt.metrics().blocking_queue_depth() > 0); drop(guard); let _ = rt.block_on(h1); let _ = rt.block_on(h2); assert_eq!(0, rt.metrics...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
81
140
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:4
#[test] fn remote_schedule_count() { use std::thread; let rt = current_thread(); let handle = rt.handle().clone(); let task = thread::spawn(move || { handle.spawn(async { // DO nothing }) }) .join() .unwrap(); rt.block_on(task).unwrap(); assert_eq!(1, r...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
121
180
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:5
assert_eq!(Some(thread::current().id()), metrics.worker_thread_id(0)); // Move runtime to another thread. let thread_id = std::thread::scope(|scope| { let join_handle = scope.spawn(|| { rt.block_on(async {}); }); join_handle.thread().id() }); assert_eq!(Some(thread_i...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
161
220
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:6
} panic!("worker did not move to new thread"); }); // After blocking task worker either stays on new thread or // is moved back to current thread. assert!( metrics.worker_thread_id(this_worker) == Some(moved_thread_id) || metrics.worker_thread_id...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
201
260
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:7
drop(rt); assert!(2 <= metrics.worker_park_unpark_count(0)); let rt = threaded(); let metrics = rt.metrics(); // Wait for workers to be parked after runtime startup. for _ in 0..100 { if 1 <= metrics.worker_park_unpark_count(0) && 1 <= metrics.worker_park_unpark_count(1) { brea...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
241
300
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:8
rt.block_on(async { time::sleep(Duration::from_millis(1)).await; }); drop(rt); assert!(0 < metrics.worker_noop_count(0)); let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async { time::sleep(Duration::from_millis(1)).await; }); drop(rt); assert!(0 < metri...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
281
340
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:9
return; } } panic!("exhausted every try to schedule the stealable task"); } #[test] fn worker_poll_count_and_time() { const N: u64 = 5; async fn task() { // Sync sleep std::thread::sleep(std::time::Duration::from_micros(10)); } let rt = current_thread(); let metri...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
321
380
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:10
}); drop(rt); // Account for the `block_on` task let n = (0..metrics.num_workers()) .map(|i| metrics.worker_poll_count(i)) .sum(); assert_eq!(N, n); let n: Duration = (0..metrics.num_workers()) .map(|i| metrics.worker_mean_poll_time(i)) .sum(); assert!(n > Dura...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
361
420
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:11
assert_eq!(num_buckets, 119); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}).await.unwrap(); } }); drop(rt); assert_eq!( metrics.poll_time_histogram_bucket_range(0), Duration::from_nanos(0)..Duration::from_nanos(96) ); assert_eq!( m...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
401
460
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:12
let num_buckets = rt.metrics().poll_time_histogram_num_buckets(); for b in 1..num_buckets - 1 { let range = metrics.poll_time_histogram_bucket_range(b); let size = range.end - range.start; // Assert the buckets continue doubling in size assert_eq!( size, Durat...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
441
500
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:13
assert_eq!(num_buckets, 119); } #[test] fn worker_poll_count_histogram() { const N: u64 = 5; let rts = [ tokio::runtime::Builder::new_current_thread() .enable_all() .enable_metrics_poll_time_histogram() .metrics_poll_time_histogram_configuration(HistogramConfigurati...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
481
540
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:14
assert!(metrics.poll_time_histogram_enabled()); assert_eq!(num_buckets, 3); let n = (0..num_workers) .flat_map(|i| (0..num_buckets).map(move |j| (i, j))) .map(|(worker, bucket)| metrics.poll_time_histogram_bucket_count(worker, bucket)) .sum(); assert_eq!(N, n...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
521
580
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:15
let a = Duration::from_nanos(50000_u64.next_power_of_two()); let b = a * 2; assert_eq!(metrics.poll_time_histogram_bucket_range(0), us(0)..a); assert_eq!(metrics.poll_time_histogram_bucket_range(1), a..b); assert_eq!(metrics.poll_time_histogram_bucket_range(2), b..max); } #[test] fn worker_poll_count_...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
561
620
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:16
let zero = Duration::from_millis(0); let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async { tokio::task::yield_now().await; }) .await .unwrap(); } }); drop(rt);...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
601
660
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:17
fn worker_local_schedule_count() { let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { tokio::spawn(async {}).await.unwrap(); }); drop(rt); assert_eq!(1, metrics.worker_local_schedule_count(0)); assert_eq!(0, metrics.remote_schedule_count()); let rt = thr...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
641
700
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:18
let (tx2, rx2) = std::sync::mpsc::channel(); // First, we need to block the other worker until all tasks have // been spawned. // // We spawn from outside the runtime to ensure that the other worker // will pick it up: // <https://github.com/tokio...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
681
740
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:19
let rt = current_thread(); let metrics = rt.metrics(); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}); } assert_eq!(N, metrics.worker_local_queue_depth(0)); }); let rt = threaded(); let metrics = rt.metrics(); rt.block_on(async move { // ...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
721
780
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:20
tx2.send(()).unwrap(); }) .await .unwrap(); }); } #[test] fn budget_exhaustion_yield() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(0, metrics.budget_forced_yield_count()); let mut did_yield = false; // block on a task which consumes budget unti...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
761
820
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:21
assert_eq!(0, metrics.budget_forced_yield_count()); let mut did_yield_1 = false; let mut did_yield_2 = false; // block on a task which consumes budget until it yields rt.block_on(async { tokio::join!( poll_fn(|cx| loop { if did_yield_1 { return P...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
801
860
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:22
#[cfg(any(target_os = "linux", target_os = "macos"))] #[test] fn io_driver_fd_count() { let rt = current_thread(); let metrics = rt.metrics(); assert_eq!(metrics.io_driver_fd_registered_count(), 0); let stream = tokio::net::TcpStream::connect("google.com:80"); let stream = rt.block_on(async move {...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
841
900
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:23
// Note that the runtime needs to have the lifo slot disabled to make // this task stealable. tokio::spawn(async move { tx.send(()).unwrap(); }); // Blocking receive on the channel, timing out if the sending task // wasn't scheduled in time. rx.recv_timeout(D...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
15495fd88305099d4ffa0a5583f6d8856d728ac3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/15495fd88305099d4ffa0a5583f6d8856d728ac3/tokio/tests/rt_unstable_metrics.rs
881
923
tokio-rs/tokio:tokio/tests/rt_unstable_metrics.rs:11
assert_eq!(num_buckets, 119); rt.block_on(async { for _ in 0..N { tokio::spawn(async {}).await.unwrap(); } }); drop(rt); assert_eq!( metrics.poll_time_histogram_bucket_range(0), Duration::from_nanos(0)..Duration::from_nanos(96) ); assert_eq!( m...
rust
rust
testsuite
tokio-rs/tokio
tokio/tests/rt_unstable_metrics.rs
MIT
4a34b77af5b6ae8addb8f60cfbda5dd2686b61d3
github
async-runtime
https://github.com/tokio-rs/tokio/blob/4a34b77af5b6ae8addb8f60cfbda5dd2686b61d3/tokio/tests/rt_unstable_metrics.rs
401
460