Two queries polled on two threads, with a nested sync span and a dependency span.
(h: &Harness)
| 84 | |
| 85 | /// Two queries polled on two threads, with a nested sync span and a dependency span. |
| 86 | fn record(h: &Harness) { |
| 87 | let (syntax, parse) = h.on_thread("a", || { |
| 88 | h.at(0); |
| 89 | let syntax = query(&QueryKey::AnalyzeFileSyntax(1)); |
| 90 | h.at(10); |
| 91 | let poll = syntax.enter(); |
| 92 | h.at(12); |
| 93 | let sync = tracing::info_span!("EmitWire").entered(); |
| 94 | h.at(15); |
| 95 | // Requested inside the `emitWire` slice: flow start here. |
| 96 | let parse = query(&QueryKey::ParseFile(1)); |
| 97 | let resolve = tracing::info_span!(target: "oxc_resolver", "resolve").entered(); |
| 98 | h.at(16); |
| 99 | drop(resolve); |
| 100 | h.at(17); |
| 101 | drop(sync); |
| 102 | h.at(20); |
| 103 | drop(poll); |
| 104 | // Dropped before completing. |
| 105 | drop(query(&QueryKey::ParseFile(2))); |
| 106 | (syntax, parse) |
| 107 | }); |
| 108 | h.on_thread("b", move || { |
| 109 | h.at(30); |
| 110 | parse.in_scope(|| h.at(34)); |
| 111 | parse.record("done", true); |
| 112 | drop(parse); |
| 113 | h.at(40); |
| 114 | syntax.in_scope(|| h.at(43)); |
| 115 | syntax.record("done", true); |
| 116 | h.at(50); |
| 117 | let analyze = tracing::info_span!(target: ASYNC_TARGET, "Analyze"); |
| 118 | analyze.in_scope(|| h.at(52)); |
| 119 | drop(analyze); |
| 120 | drop(syntax); |
| 121 | }); |
| 122 | } |
| 123 | |
| 124 | #[test] |
| 125 | fn records_per_thread_slices_flows_and_totals() { |
no test coverage detected