Skip to content

Commit

Permalink
self review
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Apr 23, 2024
1 parent 27ce535 commit b02426b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 1 addition & 3 deletions crates/re_query_cache2/src/cache_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ pub struct CachedComponentStats {

impl Caches {
/// Computes the stats for all primary caches.
///
/// `per_component` toggles per-component stats.
pub fn stats(&self) -> CachesStats {
re_tracing::profile_function!();

Expand All @@ -64,7 +62,7 @@ impl Caches {
total_instances: cache
.per_data_time
.values()
.map(|results| results.num_values())
.map(|results| results.num_instances())
.sum(),
total_size_bytes: cache.total_size_bytes(),
},
Expand Down
10 changes: 9 additions & 1 deletion crates/re_query_cache2/src/latest_at/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,16 @@ impl CachedLatestAtComponentResults {
}
}

/// How many _indices_ across this entire cache?
#[inline]
pub fn num_values(&self) -> u64 {
pub fn num_indices(&self) -> u64 {
_ = self;
1
}

/// How many _instances_ across this entire cache?
#[inline]
pub fn num_instances(&self) -> u64 {
self.cached_dense
.get()
.map_or(0u64, |cached| cached.dyn_num_values() as _)
Expand Down
5 changes: 1 addition & 4 deletions crates/re_viewer/src/ui/memory_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl MemoryPanel {
.min_width(250.0)
.default_width(300.0)
.show_inside(ui, |ui| {
self.left_side(ui, re_ui, limit, gpu_resource_stats, store_stats);
Self::left_side(ui, re_ui, limit, gpu_resource_stats, store_stats);
});

egui::CentralPanel::default().show_inside(ui, |ui| {
Expand All @@ -70,15 +70,12 @@ impl MemoryPanel {
}

fn left_side(
&self,
ui: &mut egui::Ui,
re_ui: &re_ui::ReUi,
limit: &MemoryLimit,
gpu_resource_stats: &WgpuResourcePoolStatistics,
store_stats: Option<&StoreHubStats>,
) {
_ = self;

ui.strong("Rerun Viewer resource usage");

ui.separator();
Expand Down

0 comments on commit b02426b

Please sign in to comment.