Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,13 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {

if new_items {
let elapsed = start.elapsed();
turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new(
"Finished writing to filesystem cache".to_string(),
elapsed,
)));
// avoid spamming the event queue with information about fast operations
if elapsed > Duration::from_secs(10) {
turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new(
"Finished writing to filesystem cache".to_string(),
elapsed,
)));
}
}

Some((snapshot_time, new_items))
Expand Down
15 changes: 12 additions & 3 deletions turbopack/crates/turbo-tasks-backend/src/database/turbo/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
use std::{cmp::max, path::PathBuf, sync::Arc, thread::available_parallelism, time::Instant};
use std::{
cmp::max,
path::PathBuf,
sync::Arc,
thread::available_parallelism,
time::{Duration, Instant},
};

use anyhow::{Ok, Result};
use parking_lot::Mutex;
Expand Down Expand Up @@ -135,8 +141,11 @@ fn do_compact(
})?;
if ran {
let elapsed = start.elapsed();
turbo_tasks()
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed)));
// avoid spamming the event queue with information about fast operations
if elapsed > Duration::from_secs(10) {
turbo_tasks()
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed)));
}
}
Ok(())
}
Expand Down
Loading