reverbrain / eblob

Eblob is an append-only low-level IO library, which saves data in blob files. Created as low-level backend for elliptics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extend eblob summary statistics for defragmentation status

shaitan opened this issue · comments

Current state

Currently, eblob summary has follow statistics:

  • records_removed - total number of removed records in all blobs
  • records_removed_size - total size of all removed records in all blobs
  • want_defrag - sum of want_defrag of all blobs

Problem

There is no statistics that shows the need and potential profit from defragmentation:

  • want_defrag is useless because it mixes want_defrag of all blobs
  • records_removed and records_removed_size are about all removed records from all blobs and don't show how many space will be freed by defragmentation

What is wanted to be changed

Add new statistics or change current statistics if it is possible. These statistics should show:

  • the need for defragmentation: 0 - defragmentation is useless now, 1 - defragmentation will make a profit
  • current profit from defragmentation: how many resources will be freed (disk space, fd etc.)

like!

Update

  • "profit from defragmentation" won't be implemented
  • summary:want_defrag will take one of follow values:
    • 1 - when there is at least one unsorted blob or blob with want_defrag equal to 1 (EBLOB_DEFRAG_NEEDED) or 2 (EBLOB_REMOVE_NEEDED)
    • 0 - in all other cases