MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / generate_recommendations

Method generate_recommendations

graphlite/src/cache/cache_manager.rs:660–683  ·  view source on GitHub ↗
(&self, stats: &CacheManagerStats)

Source from the content-addressed store, hash-verified

658 }
659
660 fn generate_recommendations(&self, stats: &CacheManagerStats) -> Vec<String> {
661 let mut recommendations = Vec::new();
662
663 if stats.global.overall_hit_rate() < 0.3 {
664 recommendations.push("Hit rate is low (<30%). Consider increasing cache sizes or reviewing query patterns.".to_string());
665 }
666
667 if stats.efficiency.eviction_rate > 0.1 {
668 recommendations.push("High eviction rate (>10%). Consider increasing memory limits or adjusting TTL settings.".to_string());
669 }
670
671 if stats.efficiency.memory_utilization > 0.9 {
672 recommendations.push("Memory utilization is high (>90%). Consider increasing max memory or enabling compression.".to_string());
673 }
674
675 if stats.result_cache.l1_hit_rate() < 0.1 {
676 recommendations.push(
677 "L1 cache hit rate is very low. Consider adjusting L1 size or TTL settings."
678 .to_string(),
679 );
680 }
681
682 recommendations
683 }
684}
685
686/// Comprehensive cache statistics

Callers 1

get_health_scoreMethod · 0.80

Calls 2

overall_hit_rateMethod · 0.80
l1_hit_rateMethod · 0.80

Tested by

no test coverage detected