pmemkv
pmemkv copied to clipboard
Any way to get the kv usage of total db capactiy?
I would need an interface to query the current used or remaining capacity. I know we can scan to get this but it's not good way to scan each time for query.
Right now there is no such API but in future we might expose pmemobj statistics (number of allocated bytes, number of active/allocated runs): https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_ctl_get.3. However, even with such API, finding out what is the remaining capacity is not an easy task. The number of entries which you can add to the pmemkv, might be a lot less than the "remaining capacity". One reason is fragmentation (both internal and external).