Skip to content

Commit 7814230

Browse files
committed
refactor(timings): move Concurrency into report module
It is no longer used outside the module
1 parent c33cb78 commit 7814230

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/cargo/core/compiler/timings/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,6 @@ struct UnitTime {
103103
sections: IndexMap<String, CompilationSection>,
104104
}
105105

106-
/// Periodic concurrency tracking information.
107-
#[derive(serde::Serialize)]
108-
struct Concurrency {
109-
/// Time as an offset in seconds from `Timings::start`.
110-
t: f64,
111-
/// Number of units currently running.
112-
active: usize,
113-
/// Number of units that could run, but are waiting for a jobserver token.
114-
waiting: usize,
115-
/// Number of units that are not yet ready, because they are waiting for
116-
/// dependencies to finish.
117-
inactive: usize,
118-
}
119-
120106
/// Data for a single compilation unit, prepared for serialization to JSON.
121107
///
122108
/// This is used by the HTML report's JavaScript to render the pipeline graph.

src/cargo/core/compiler/timings/report.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use itertools::Itertools as _;
1111
use crate::CargoResult;
1212
use crate::core::compiler::Unit;
1313

14-
use super::Concurrency;
1514
use super::UnitData;
1615
use super::UnitTime;
1716

@@ -82,6 +81,20 @@ impl SectionData {
8281
}
8382
}
8483

84+
/// Concurrency tracking information.
85+
#[derive(serde::Serialize)]
86+
pub struct Concurrency {
87+
/// Time as an offset in seconds from `Timings::start`.
88+
t: f64,
89+
/// Number of units currently running.
90+
active: usize,
91+
/// Number of units that could run, but are waiting for a jobserver token.
92+
waiting: usize,
93+
/// Number of units that are not yet ready, because they are waiting for
94+
/// dependencies to finish.
95+
inactive: usize,
96+
}
97+
8598
pub struct RenderContext<'a> {
8699
/// When Cargo started.
87100
pub start: Instant,

0 commit comments

Comments
 (0)