Skip to main content

Properties

GetProperty takes the property names of RocksDB, with the rocksdb. prefix, and returns a decimal integer as a string. It returns null for a name that it does not support. The values match those of RocksDB for the same writes, flushes, and compactions, except for the memory figures noted below.

string? value = db.GetProperty("rocksdb.num-files-at-level0", family);

Properties of a column family​

These take a column family. When you pass none, they use the default column family.

PropertyValue
rocksdb.num-entries-active-mem-tableThe entries of the active memtable. Every put, delete, and range delete counts.
rocksdb.num-immutable-mem-tableThe memtables that wait for a flush or are in a flush.
rocksdb.mem-table-flush-pending1 when a memtable waits for a flush that has not started, else 0.
rocksdb.cur-size-all-mem-tablesThe bytes of the active memtable and of the memtables not yet flushed.
rocksdb.estimate-table-readers-memThe bytes that the open SSTables keep in memory: index, filter, and range tombstones. With CacheIndexAndFilterBlocks, the range tombstones only.
rocksdb.live-sst-files-sizeThe bytes of the SSTables of the current version.
rocksdb.num-files-at-level0 to rocksdb.num-files-at-level6The SSTables in each level.
rocksdb.base-levelThe level that level 0 compacts into.
rocksdb.block-cache-capacityThe capacity of the BlockCache of the column family.
rocksdb.block-cache-usageThe bytes in that cache, for everything that shares it, pinned entries included.
rocksdb.block-cache-pinned-usageThe bytes of that cache that cannot be evicted.
rocksdb.compaction-pending1 when a level needs a compaction, else 0. That is, level 0 holds Level0FileNumCompactionTrigger files, or a sorted level above the bottom holds more than its target. The files that a compaction reads do not count.

Properties of the database​

These are the same for every column family.

PropertyValue
rocksdb.num-running-flushes0 or 1. There is one flush thread.
rocksdb.num-running-compactionsThe compactions that run now, from 0 to MaxBackgroundCompactions.
rocksdb.is-write-stopped1 while writes are stopped, else 0.
rocksdb.actual-delayed-write-rateThe rate in bytes per second while writes are delayed, else 0.

Properties that return null​

PropertyWhy
rocksdb.block-cache-capacity, rocksdb.block-cache-usage, rocksdb.block-cache-pinned-usageFor a column family without a BlockCache. RocksDB with no block cache also returns null.
Any other nameNot supported.

Memory figures​

The memory figures count what the data needs, not what was allocated:

  • cur-size-all-mem-tables counts the keys and values of each memtable, plus 32 bytes for each entry, and the fragments of its range tombstones. An empty memtable is 0. RocksDB counts the arena blocks that it allocated, 2 KB for an empty memtable.
  • estimate-table-readers-mem counts the index keys and handles, the filter bits, and the range tombstones and their fragments of each open table. With CacheIndexAndFilterBlocks, it counts the range tombstones and their fragments only, as RocksDB leaves out the cached blocks.