Merge "logd: pruning time horizon"
am: 183df3ddf7
* commit '183df3ddf72e5b7685f8fe4ae4c1f918968afa5d':
logd: pruning time horizon
This commit is contained in:
commit
83f1cd2ae4
1 changed files with 4 additions and 1 deletions
|
@ -436,7 +436,10 @@ bool LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
|
|||
worst_sizes = sorted[0]->getSizes();
|
||||
// Calculate threshold as 12.5% of available storage
|
||||
size_t threshold = log_buffer_size(id) / 8;
|
||||
if (worst_sizes > threshold) {
|
||||
if ((worst_sizes > threshold)
|
||||
// Allow time horizon to extend roughly tenfold, assume
|
||||
// average entry length is 100 characters.
|
||||
&& (worst_sizes > (10 * sorted[0]->getDropped()))) {
|
||||
worst = sorted[0]->getKey();
|
||||
second_worst_sizes = sorted[1]->getSizes();
|
||||
if (second_worst_sizes < threshold) {
|
||||
|
|
Loading…
Reference in a new issue