10 size_t removed_ctr = 0;
14 SkipListAcc acc(inherited::m_latency_buffer->get_skip_list());
15 auto tail = acc.last();
16 auto head = acc.first();
18 tailts = (*tail).get_timestamp();
19 headts = (*head).get_timestamp();
20 TLOG_DEBUG(TLVL_WORK_STEPS) <<
"Cleanup REQUEST with "
21 <<
"Oldest stored TS=" << headts <<
" "
22 <<
"Newest stored TS=" << tailts;
23 if (tailts - headts > m_max_ts_diff) {
24 ++(inherited::m_pop_reqs);
25 uint64_t timediff = m_max_ts_diff;
26 while (timediff >= m_max_ts_diff) {
27 bool removed = acc.remove(*head);
29 TLOG_DEBUG(TLVL_WORK_STEPS) <<
"Unsuccesfull remove from SKL during cleanup: " << removed;
34 headts = (*head).get_timestamp();
35 timediff = tailts - headts;
37 inherited::m_pops_count += removed_ctr;
40 TLOG_DEBUG(TLVL_WORK_STEPS) <<
"Didn't manage to get SKL head and tail!";
43 inherited::m_num_buffer_cleanups++;