(&self)
| 178 | |
| 179 | impl CacheStats { |
| 180 | pub fn hit_rate(&self) -> f64 { |
| 181 | if self.total_requests == 0 { |
| 182 | 0.0 |
| 183 | } else { |
| 184 | (self.l1_hits + self.l2_hits) as f64 / self.total_requests as f64 |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | pub fn l1_hit_rate(&self) -> f64 { |
| 189 | if self.total_requests == 0 { |
nothing calls this directly
no outgoing calls
no test coverage detected