Skip to content

Commit

Permalink
[checkpoints] Break down checkpoint builder scope for better visibili…
Browse files Browse the repository at this point in the history
…ty (MystenLabs#7904)

This PR adds additional monitored scopes to checkpoint builder to break
dgown checkpoint creation time
  • Loading branch information
andll authored Jan 30, 2023
1 parent 0ddf133 commit 964cd89
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/sui-core/src/checkpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ impl CheckpointBuilder {
.await?;
let _scope = monitored_scope("CheckpointBuilder");
let unsorted = self.complete_checkpoint_effects(roots)?;
let sorted = CasualOrder::casual_sort(unsorted);
let sorted = {
let _scope = monitored_scope("CheckpointBuilder::casual_sort");
CasualOrder::casual_sort(unsorted)
};
let new_checkpoint = self.create_checkpoints(sorted, pending.details).await?;
self.write_checkpoints(height, new_checkpoint).await?;
Ok(())
Expand All @@ -486,6 +489,7 @@ impl CheckpointBuilder {
height: CheckpointCommitHeight,
new_checkpoint: Vec<(CheckpointSummary, CheckpointContents)>,
) -> SuiResult {
let _scope = monitored_scope("CheckpointBuilder::write_checkpoints");
let mut batch = self.tables.checkpoint_content.batch();
for (summary, contents) in &new_checkpoint {
debug!(
Expand Down Expand Up @@ -521,6 +525,7 @@ impl CheckpointBuilder {
all_effects: Vec<TransactionEffects>,
details: PendingCheckpointInfo,
) -> anyhow::Result<Vec<(CheckpointSummary, CheckpointContents)>> {
let _scope = monitored_scope("CheckpointBuilder::create_checkpoints");
let total = all_effects.len();
let mut last_checkpoint = self.epoch_store.last_built_checkpoint_summary()?;
if last_checkpoint.is_none() {
Expand Down Expand Up @@ -725,6 +730,7 @@ impl CheckpointBuilder {
&self,
mut roots: Vec<VerifiedSignedTransactionEffects>,
) -> SuiResult<Vec<TransactionEffects>> {
let _scope = monitored_scope("CheckpointBuilder::complete_checkpoint_effects");
let mut results = vec![];
let mut seen = HashSet::new();
loop {
Expand Down

0 comments on commit 964cd89

Please sign in to comment.