Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: segment tree insertion stats by depth #4029

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions yarn-project/circuit-types/src/stats/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,25 @@ export const Metrics = [
events: ['tx-sequencer-processing'],
},
{
name: 'batch_insert_into_append_only_tree_ms',
name: 'batch_insert_into_append_only_tree_16_depth_ms',
groupBy: 'leaf-count',
description: 'Time to insert a batch of leaves into an append-only tree',
events: ['tree-insertion'],
},
{
name: 'batch_insert_into_indexed_tree_ms',
name: 'batch_insert_into_append_only_tree_32_depth_ms',
groupBy: 'leaf-count',
description: 'Time to insert a batch of leaves into an append-only tree',
events: ['tree-insertion'],
},
{
name: 'batch_insert_into_indexed_tree_20_depth_ms',
groupBy: 'leaf-count',
description: 'Time to insert a batch of leaves into an indexed tree',
events: ['tree-insertion'],
},
{
name: 'batch_insert_into_indexed_tree_40_depth_ms',
groupBy: 'leaf-count',
description: 'Time to insert a batch of leaves into an indexed tree',
events: ['tree-insertion'],
Expand Down
13 changes: 11 additions & 2 deletions yarn-project/scripts/src/benchmarks/aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,19 @@ function processTxSequencerProcessingStats(entry: TxSequencerProcessingStats, re
/** Process a tree insertion event and updates results */
function processTreeInsertion(entry: TreeInsertionStats, results: BenchmarkCollectedResults) {
const bucket = entry.batchSize;
const depth = entry.treeDepth;
if (entry.treeType === 'append-only') {
append(results, 'batch_insert_into_append_only_tree_ms', bucket, entry.duration);
if (depth === 16) {
append(results, 'batch_insert_into_append_only_tree_16_depth_ms', bucket, entry.duration);
} else if (depth === 32) {
append(results, 'batch_insert_into_append_only_tree_32_depth_ms', bucket, entry.duration);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗ This ignores every other tree depth

We should revisit this once the metrics definition supports dynamic metric names

} else if (entry.treeType === 'indexed') {
append(results, 'batch_insert_into_indexed_tree_ms', bucket, entry.duration);
if (depth === 20) {
append(results, 'batch_insert_into_indexed_tree_20_depth_ms', bucket, entry.duration);
} else if (depth === 40) {
append(results, 'batch_insert_into_indexed_tree_40_depth_ms', bucket, entry.duration);
}
}
}

Expand Down