| 9 | using namespace std; |
| 10 | |
| 11 | void PopularityDecay::turn_on_stream_dump(string &path_base) { |
| 12 | #ifdef USE_REQ_METRIC |
| 13 | stream_dump_req_ofs.open( |
| 14 | path_base + ".popularityDecay_w" + to_string(time_window_) + "_req", |
| 15 | ios::out | ios::trunc); |
| 16 | stream_dump_req_ofs << "# " << path_base << "\n"; |
| 17 | stream_dump_req_ofs |
| 18 | << "# req_cnt for new object in prev N windows (time window " |
| 19 | << time_window_ << ")\n"; |
| 20 | #endif |
| 21 | |
| 22 | stream_dump_obj_ofs.open( |
| 23 | path_base + ".popularityDecay_w" + to_string(time_window_) + "_obj", |
| 24 | ios::out | ios::trunc); |
| 25 | stream_dump_obj_ofs << "# " << path_base << "\n"; |
| 26 | stream_dump_obj_ofs |
| 27 | << "# obj_cnt for new object in prev N windows (time window " |
| 28 | << time_window_ << ")\n"; |
| 29 | } |
| 30 | |
| 31 | void PopularityDecay::add_req(const request_t *req) { |
| 32 | if (unlikely(next_window_ts_ == -1)) { |
nothing calls this directly
no test coverage detected