vmware / splinterdb

High Performance Embedded Key-Value Store
https://splinterdb.org
Apache License 2.0
684 stars 57 forks source link

Fix bug in output formatted by size_to_str() helper. #563

Closed gapisback closed 1 year ago

gapisback commented 1 year ago

Fractional portion of value formatted by size_to_str() was incorrect. We were losing the scale for things which were supposed to be "xx.07", we were reporting "xx.7", which is incorrect.

netlify[bot] commented 1 year ago

Deploy Preview for splinterdb canceled.

Name Link
Latest commit 25e7682140e869e036bb5b057680da00c57707f6
Latest deploy log https://app.netlify.com/sites/splinterdb/deploys/642e22290dc4ab000849664b
gapisback commented 1 year ago

This was fortunately recognized and reported by @rosenhouse, in an internal slack thread:

Really small thing, but looking at the “Shared memory usage stats”, I see:

Shared memory usage stats shmid=27: Total=2222981120 bytes (~2.7 GiB), Used=1527320576 bytes (~1.42 GiB, 68.71 %), Free=695654272 bytes (~663.42 MiB, 31.29 %), nfrees=202000, nf_search_skipped=197988 (98 %), Large fragments in-use HWM=3616 (found in-use=0), consumed=1512585728 bytes (~1.40 GiB).

where that first Total bit Total=2222981120 bytes (~2.7 GiB) looks wrong: 2222981120 / 2^30 is about 2.07, not 2.7