-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: CubDB.number_of_writes/1
#58
Comments
Hi @eksperimental , The dirt factor is calculated on the basis of the number of writes since the last compaction, and the number of entries in the database. It basically estimates how much data stored in the file is unreachable “garbage” relative to the size of the database. Automatic compaction is triggered when the dirt factor is over a given threshold, AND the number of writes since the last compaction is at least a given number. If I understand, you would like to have a function that tells you the number of writes since the last compaction. That’s possible, but can I ask what’s the use case, and in particular why auto compaction won’t work in that case? |
I have a cron job and I want to manually compact only when the cron job is executed, so I would be checking the number of writes since the last compaction AND the dirt factor, but based on what you say the dirt factor is already calculated, but the docs mentions both value as a requirement to trigger the autocompact. |
I can add such feature in the next release, possibly under a slightly different name (maybe |
Sounds great. Looking forward to it. |
I would like to propose, on the same vein as
CubDB.dirt_factor/1
, I think it will be useful to have a public API withCubDB.number_of_writes/1
, so we could manually triggerCubDB.compact/1
based these two factors.Thank you.
The text was updated successfully, but these errors were encountered: