Unverified Commit bdf01611 authored by hhzhang16's avatar hhzhang16 Committed by GitHub
Browse files

fix: implement block_count and worker_count for CRTC (#8559)


Signed-off-by: default avatarHannah Zhang <hannahz@nvidia.com>
parent 60764414
......@@ -712,6 +712,17 @@ impl SyncIndexer for ConcurrentRadixTree {
cleanup_guard.mark_completed();
}
fn worker_count(&self) -> usize {
self.tree_sizes.len()
}
fn block_count(&self) -> usize {
self.tree_sizes
.iter()
.map(|e| e.value().load(Ordering::Relaxed))
.sum()
}
fn dump_events(&self) -> Option<Vec<RouterEvent>> {
Some(self.dump_tree_as_events())
}
......
......@@ -1388,6 +1388,17 @@ impl SyncIndexer for ConcurrentRadixTreeCompressed {
cleanup_guard.mark_completed();
}
fn worker_count(&self) -> usize {
self.tree_sizes.len()
}
fn block_count(&self) -> usize {
self.tree_sizes
.iter()
.map(|e| e.value().load(Ordering::Relaxed))
.sum()
}
fn dump_events(&self) -> Option<Vec<RouterEvent>> {
Some(self.dump_tree_as_events())
}
......
......@@ -190,6 +190,17 @@ impl SyncIndexer for PositionalIndexer {
fn find_matches(&self, sequence: &[LocalBlockHash], early_exit: bool) -> OverlapScores {
self.jump_search_matches(sequence, early_exit)
}
fn worker_count(&self) -> usize {
self.tree_sizes.len()
}
fn block_count(&self) -> usize {
self.tree_sizes
.iter()
.map(|e| e.value().load(Ordering::Relaxed))
.sum()
}
}
// ============================================================================
......
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