Unverified Commit b09df006 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Turbopack: add family to database read span (#88323)

### What?

This makes database read spans being grouped per family
parent 40ad57e8
...@@ -1338,8 +1338,11 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES> ...@@ -1338,8 +1338,11 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES>
/// might hold onto a block of the database and it should not be hold long-term. /// might hold onto a block of the database and it should not be hold long-term.
pub fn get<K: QueryKey>(&self, family: usize, key: &K) -> Result<Option<ArcSlice<u8>>> { pub fn get<K: QueryKey>(&self, family: usize, key: &K) -> Result<Option<ArcSlice<u8>>> {
debug_assert!(family < FAMILIES, "Family index out of bounds"); debug_assert!(family < FAMILIES, "Family index out of bounds");
let span = let span = tracing::trace_span!(
tracing::trace_span!("database read", family, result_size = tracing::field::Empty) "database read",
name = family,
result_size = tracing::field::Empty
)
.entered(); .entered();
let hash = hash_key(key); let hash = hash_key(key);
let inner = self.inner.read(); let inner = self.inner.read();
...@@ -1410,7 +1413,7 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES> ...@@ -1410,7 +1413,7 @@ impl<S: ParallelScheduler, const FAMILIES: usize> TurboPersistence<S, FAMILIES>
debug_assert!(family < FAMILIES, "Family index out of bounds"); debug_assert!(family < FAMILIES, "Family index out of bounds");
let span = tracing::trace_span!( let span = tracing::trace_span!(
"database batch read", "database batch read",
family, name = family,
keys = keys.len(), keys = keys.len(),
not_found = tracing::field::Empty, not_found = tracing::field::Empty,
deleted = tracing::field::Empty, deleted = tracing::field::Empty,
......
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