Skip to content

Commit 59900b8

Browse files
authored
Merge pull request #73 from spinel-coop/segiddins/rayon-tracing
propagate current tracing span when using rayon
2 parents 760a78b + adf0b29 commit 59900b8

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ indexmap = "2.0"
3131
indicatif = "0.18.0"
3232
indoc = "2.0.6"
3333
insta = "1.40"
34+
lazy_static = "1.4.0"
3435
miette = "7.6.0"
3536
once_cell = "1.20.1"
3637
owo-colors = "4.1.0"
3738
pretty_assertions = "1.4.1"
3839
rayon = "1.10.0"
40+
rayon-tracing = { git = "https://github.com/danylaporte/rayon-tracing", version = "0.1.1", rev = "v0.1.1" }
3941
regex = "1.11.1"
4042
reqwest = { version = "0.12.22", default-features = false, features = [
4143
"rustls-tls",

crates/rv/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ current_platform = { workspace = true }
4646
fs-err = { workspace = true }
4747
bytesize = { workspace = true }
4848
shell-escape = { workspace = true }
49-
lazy_static = "1.4.0"
49+
lazy_static = { workspace = true }
50+
rayon-tracing = { workspace = true }
5051

5152
[dev-dependencies]
5253
insta = { workspace = true }

crates/rv/src/config/ruby_cache.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use camino::Utf8Path;
22
use miette::{IntoDiagnostic, Result};
33
use rayon::prelude::*;
4+
use rayon_tracing::TracedIndexedParallelIterator;
45
use tracing::debug;
56

67
use rv_ruby::Ruby;
@@ -117,6 +118,7 @@ impl Config {
117118
// Process Ruby paths in parallel for better performance
118119
let mut rubies: Vec<Ruby> = ruby_paths
119120
.into_par_iter()
121+
.indexed_in_span(tracing::span::Span::current())
120122
.filter_map(|ruby_path| {
121123
// Try to get Ruby from cache first
122124
match self.get_cached_ruby(&ruby_path) {

0 commit comments

Comments
 (0)