The normalized hit rate for a given load. * * The semantics are a little confusing, so please see the below * explanation. * * Examples: * * 1. at load 0.5, we expect a perfect hit rate, so we multiply by * 1.0 * 2. at load 2.0, we expect to see half the entries, so a perfect hit rate * would be 0.5. Therefore, if we see a hit rate of 0.4, 0.4*2.0 = 0.8 is the * normalized hit rate. *
| 99 | * becomes effectively perfect, ignoring freshness. |
| 100 | */ |
| 101 | static double normalize_hit_rate(double hits, double load) |
| 102 | { |
| 103 | return hits * std::max(load, 1.0); |
| 104 | } |
| 105 | |
| 106 | /** Check the hit rate on loads ranging from 0.1 to 1.6 */ |
| 107 | BOOST_AUTO_TEST_CASE(cuckoocache_hit_rate_ok) |
no outgoing calls
no test coverage detected