pub struct MetricsCache { /* private fields */ }Expand description
In-memory cache for graph metrics, keyed by a SHA-256 hash of the graph structure.
The cache avoids recomputing expensive metrics (PageRank, betweenness, HITS, etc.) when the underlying issue graph has not changed. This is especially valuable for TUI sessions where multiple views read the same metrics repeatedly.
Implementations§
Source§impl MetricsCache
impl MetricsCache
Sourcepub fn get_or_compute(
&self,
issues: &[Issue],
config: &AnalysisConfig,
) -> GraphMetrics
pub fn get_or_compute( &self, issues: &[Issue], config: &AnalysisConfig, ) -> GraphMetrics
Compute (or retrieve cached) metrics for the given issues and config.
The cache key is a SHA-256 hash of the graph structure (sorted node IDs, edges, and issue statuses) plus the analysis config.
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Return cache statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricsCache
impl RefUnwindSafe for MetricsCache
impl Send for MetricsCache
impl Sync for MetricsCache
impl Unpin for MetricsCache
impl UnsafeUnpin for MetricsCache
impl UnwindSafe for MetricsCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more