Skip to content

Commit

Permalink
Add tracing to begin_tx (#31175)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 9682e637f169cbc5e14b85dec46325030ee5ebe4
  • Loading branch information
jordanhunt22 authored and Convex, Inc. committed Oct 29, 2024
1 parent 26f403a commit b7bdf2e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/database/src/component_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct ComponentRegistry {
}

impl ComponentRegistry {
#[minitrace::trace]
pub fn bootstrap(
table_mapping: &TableMapping,
component_docs: Vec<ParsedDocument<ComponentMetadata>>,
Expand Down
1 change: 1 addition & 0 deletions crates/database/src/table_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ impl TableRegistry {
/// Fill out all of our table metadata from the latest version of each
/// document in the `_tables` table. In particular, we expect to find
/// exactly one record for the `_tables` table.
#[minitrace::trace]
pub fn bootstrap(
table_mapping: TableMapping,
table_states: OrdMap<TabletId, TableState>,
Expand Down
3 changes: 3 additions & 0 deletions crates/function_runner/src/in_memory_indexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl<RT: Runtime> InMemoryIndexCache<RT> {
/// Get the index from the cache or load it from persistence and put it in
/// the cache. If the index is not in the last_modified map, it is not an
/// in-memory index and should not be cached.
#[minitrace::trace]
async fn get_or_load(
&self,
instance_name: String,
Expand Down Expand Up @@ -232,6 +233,7 @@ impl<RT: Runtime> InMemoryIndexCache<RT> {
cache_value_result
}

#[minitrace::trace(properties = { "table_name": "{table_name:?}" })]
pub async fn must_get_or_load_unpacked(
&self,
instance_name: String,
Expand All @@ -255,6 +257,7 @@ impl<RT: Runtime> InMemoryIndexCache<RT> {
Ok(index_map.0.into_iter().map(|(_k, (_ts, v))| v.unpack()))
}

#[minitrace::trace]
async fn load_registries(
&self,
persistence_snapshot: PersistenceSnapshot,
Expand Down
1 change: 1 addition & 0 deletions crates/indexing/src/index_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl IndexRegistry {
/// document in the `_index` table. After initializing each index, mark
/// all of them as completed since we'll be streaming in all non
/// `_index` documents later.
#[minitrace::trace]
pub fn bootstrap<'a>(
table_mapping: &TableMapping,
index_documents: impl Iterator<Item = &'a ResolvedDocument>,
Expand Down

0 comments on commit b7bdf2e

Please sign in to comment.