Commit 2b10a256 authored by Tobias Koppers's avatar Tobias Koppers

Turbopack: only show database timing when it's slower than a second

parent bf8cadd8
...@@ -1184,11 +1184,13 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> { ...@@ -1184,11 +1184,13 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
if new_items { if new_items {
let elapsed = start.elapsed(); let elapsed = start.elapsed();
if elapsed.as_secs() >= 1 {
turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new( turbo_tasks().send_compilation_event(Arc::new(TimingEvent::new(
"Finished writing to filesystem cache".to_string(), "Finished writing to filesystem cache".to_string(),
elapsed, elapsed,
))); )));
} }
}
Some((snapshot_time, new_items)) Some((snapshot_time, new_items))
} }
......
...@@ -135,9 +135,11 @@ fn do_compact( ...@@ -135,9 +135,11 @@ fn do_compact(
})?; })?;
if ran { if ran {
let elapsed = start.elapsed(); let elapsed = start.elapsed();
if elapsed.as_secs() >= 1 {
turbo_tasks() turbo_tasks()
.send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed))); .send_compilation_event(Arc::new(TimingEvent::new(message.to_string(), elapsed)));
} }
}
Ok(()) Ok(())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment