If the object decrement time is reached decrement the LFU counter but * do not update LFU fields of the object, we update the access time * and counter in an explicit way when the object is really accessed. * And we will times halve the counter according to the times of * elapsed time than g_pserver->lfu_decay_time. * Return the object frequency counter. * * This function is used in order t
| 327 | * to fit: as we check for the candidate, we incrementally decrement the |
| 328 | * counter of the scanned objects if needed. */ |
| 329 | unsigned long LFUDecrAndReturn(robj_roptr o) { |
| 330 | unsigned long ldt = o->lru >> 8; |
| 331 | unsigned long counter = o->lru & 255; |
| 332 | unsigned long num_periods = g_pserver->lfu_decay_time ? LFUTimeElapsed(ldt) / g_pserver->lfu_decay_time : 0; |
| 333 | if (num_periods) |
| 334 | counter = (num_periods > counter) ? 0 : counter - num_periods; |
| 335 | return counter; |
| 336 | } |
| 337 | |
| 338 | unsigned long getClientReplicationBacklogSharedUsage(client *c); |
| 339 |
no test coverage detected