add cache usage to cache.stats()
Right now it is PITA to determine real cache usage because LMDB file size does not reflect space freed by garbage collector etc.
I propose to add new item usage
to table returned by cache.stats()
. It should be float number <0,100> %.
It's value should be computed like Number of pages used
/Max pages
. Command line equivalent for testing purposes is:
$ mdb_stat -e <cache_path>
Environment Info
Map address: (nil)
Map size: 104857600
Page size: 4096
Max pages: 25600
Number of pages used: 15
Last transaction ID: 766
Max readers: 126
Number of readers used: 0
Edited by Petr Špaček