Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Add batch stats (#18096) (#18142)
Browse files Browse the repository at this point in the history
(cherry picked from commit e808f34)

Co-authored-by: sakridge <sakridge@gmail.com>
  • Loading branch information
mergify[bot] and sakridge authored Jun 23, 2021
1 parent f41f3f6 commit 26fdf3f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/src/progress_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ impl ReplaySlotStats {
("load_us", self.execute_timings.load_us, i64),
("execute_us", self.execute_timings.execute_us, i64),
("store_us", self.execute_timings.store_us, i64),
(
"total_batches_len",
self.execute_timings.total_batches_len,
i64
),
(
"num_execute_batches",
self.execute_timings.num_execute_batches,
i64
),
(
"serialize_us",
self.execute_timings.details.serialize_us,
Expand Down
2 changes: 2 additions & 0 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ fn execute_batches(
})
});

timings.total_batches_len += batches.len();
timings.num_execute_batches += 1;
for timing in new_timings {
timings.accumulate(&timing);
}
Expand Down
4 changes: 4 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ pub struct ExecuteTimings {
pub load_us: u64,
pub execute_us: u64,
pub store_us: u64,
pub total_batches_len: usize,
pub num_execute_batches: u64,
pub details: ExecuteDetailsTimings,
}

Expand All @@ -166,6 +168,8 @@ impl ExecuteTimings {
self.load_us += other.load_us;
self.execute_us += other.execute_us;
self.store_us += other.store_us;
self.total_batches_len += other.total_batches_len;
self.num_execute_batches += other.num_execute_batches;
self.details.accumulate(&other.details);
}
}
Expand Down

0 comments on commit 26fdf3f

Please sign in to comment.