| 172 | })); |
| 173 | |
| 174 | TEST_P(CacheBench, RunBench) { |
| 175 | const BenchSetup& setup = GetParam(); |
| 176 | |
| 177 | // Run a short warmup phase to try to populate the cache. Otherwise even if the |
| 178 | // dataset is smaller than the cache capacity, we would count a bunch of misses |
| 179 | // during the warm-up phase. |
| 180 | LOG(INFO) << "Warming up..."; |
| 181 | RunQueryThreads(FLAGS_num_threads, 1); |
| 182 | |
| 183 | LOG(INFO) << "Running benchmark..."; |
| 184 | pair<int64_t, int64_t> hits_lookups = RunQueryThreads(FLAGS_num_threads, FLAGS_run_seconds); |
| 185 | int64_t hits = hits_lookups.first; |
| 186 | int64_t lookups = hits_lookups.second; |
| 187 | |
| 188 | int64_t l_per_sec = lookups / FLAGS_run_seconds; |
| 189 | double hit_rate = static_cast<double>(hits) / lookups; |
| 190 | string test_case = setup.ToString(); |
| 191 | LOG(INFO) << test_case << ": " << HumanReadableNum::ToString(l_per_sec) << " lookups/sec"; |
| 192 | LOG(INFO) << test_case << ": " << StringPrintf("%.1f", hit_rate * 100.0) << "% hit rate"; |
| 193 | } |
| 194 | |
| 195 | } // namespace impala |
| 196 |
nothing calls this directly
no test coverage detected