Get cache hit rate
(&self)
| 498 | |
| 499 | /// Get cache hit rate |
| 500 | pub fn get_cache_hit_rate(&self) -> f64 { |
| 501 | let stats = self.stats.read().unwrap(); |
| 502 | if stats.total_queries > 0 { |
| 503 | stats.cache_hits as f64 / stats.total_queries as f64 |
| 504 | } else { |
| 505 | 0.0 |
| 506 | } |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | #[cfg(test)] |
no test coverage detected