Modern Apps git

← Modern-Apps.git

musicbrainz: timestamp build phases for RSS attribution

Commit
6d3dd64e8136ab321daa22ff81f1763d73944572
Author
vayun-mathur <[email protected]>
When
2026-08-20 23:23 UTC (3 months ago)
Parents
8f7d79e

Diff

scripts/musicbrainz/mb_ingest/src/build.rs
diff --git a/scripts/musicbrainz/mb_ingest/src/build.rs b/scripts/musicbrainz/mb_ingest/src/build.rsindex 6e2ea3d46b..47b1906837 100644--- a/scripts/musicbrainz/mb_ingest/src/build.rs+++ b/scripts/musicbrainz/mb_ingest/src/build.rs@@ -581,8 +581,18 @@ pub fn build<W: Write + Seek>(     let mut st = BuildStats::default();     let mut pool = StringPool::new();     let mut enums = EnumPool::new();+    // Phase lines carry elapsed seconds so an external RSS sampler can be joined+    // against them. Peak memory per phase is measured that way rather than+    // modelled: the one time it was modelled, the estimate was wrong by 3x.+    let started = std::time::Instant::now();     macro_rules! step {-        ($($arg:tt)*) => { if opts.verbose { writeln!(log, $($arg)*)?; } };+        ($($arg:tt)*) => {+            if opts.verbose {+                write!(log, "[{:8.2}s] ", started.elapsed().as_secs_f64())?;+                writeln!(log, $($arg)*)?;+                log.flush()?;+            }+        };     }      // --- areas and the small enumerations -------------------------------------@@ -1603,6 +1613,7 @@ pub fn build<W: Write + Seek>(      // STRINGS goes last: it is only complete now, and streaming it here means the     // sorted pool is never materialised as a second buffer.+    step!("pass 15: STRINGS ({} MB raw)", pool.raw_len() / 1_000_000);     let mut string_blocks = 0u32;     if opts.compress_strings {         let mut bw = StringBlockWriter::new();